NSFileManager vs Non-Packaged application: 0 - 1
NSFileManager vs Non-Packaged application: 0 - 1
- Subject: NSFileManager vs Non-Packaged application: 0 - 1
- From: stephane sudre <email@hidden>
- Date: Mon, 7 Mar 2005 12:35:37 +0100
It looks there is a bug in either the NSFileManager code or
documentation:
According to the documentation:
------------8<--------------8<--------------8<--------------
isExecutableFileAtPath:
- (BOOL)isExecutableFileAtPath:(NSString *)path
Returns YES if the underlying operating system appears able to execute
the file specified in path and NO if it cannot. This method traverses
symbolic links.
If the file at path does not exist, this method returns NO.
------------8<--------------8<--------------8<--------------
Well, this does not really apply to the real world.
If the application (RealBasic or Carbon non packaged) does not have its
execute flags set, the result will be no.
YET the operating system is able to execute the file specified in path
as you can double-click it in the Finder and it will get launched.
--------8<-----------8<------------8<------------
Is there any official solution to know if a file is an executable?
Of course, I could read the 8 first bytes of the file and see if it
starts with Joy!peff or 0xfeedface but since the code can be in a
resource in the first case....
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden