discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

porting GWorkspace to osx


From: Enrico Sersale
Subject: porting GWorkspace to osx
Date: Fri, 7 Feb 2003 13:37:37 +0200 (EET)

I've bought an old iMac and, by joke, I'm trying to port GWorkspace.
Actually it compiles, builds and runs.
But it does about nothing, so, to see, for example, why the
draggingPasteboard seems to have no data, I've added some NSLog.
And here I've noticed an interesting think.
NSWorkspace's -getInfoForFile:application:type: is used in many places in
the GW sources, and here are some example of what I get:

       path = /Applications/Mail.app
application = /Applications/Mail.app
       type = app

       path = /bin/bash
application = (null)
       type =

       path = /etc
application = /System/Library/CoreServices/Finder.app
       type =

       path = /Users/enrico/afile.gif
application = /Applications/Preview.app
       type = gif

       path = /Users/enrico/aplainfile
application = (null)
       type =

       path = /Volumes/X-ChatAqua   (a mounted disk image)
application = /System/Library/CoreServices/Finder.app
       type = 0

>From the Apple documentation, regarding -getInfoForFile:application:type::
"Retrieves information about the file specified by fullPath.  If this
method returns YES, the NSString pointed to by appName is set to the
application the system would use to open fullPath.  The NSString pointed
to by type contains one of the values described in "Constants"."

Probably, all of us knows these constants but I write them here:

Constant                Description

NSPlainFileType         Plain (untyped) file
NSDirectoryFileType     Directory
NSApplicationFileType   Cocoa application
NSFilesystemFileType    File-system mount point
NSShellCommandFileType  Executable shell command

As you can see, NO ONE OF THEM is used!

They use the suffix if this exists (app, gif, pdf), an empty string if no
suffix and "0" for the mounted volume!

And there are people speaking about compatibility...






reply via email to

[Prev in Thread] Current Thread [Next in Thread]