On Feb 16, 2007, at 12:06 PM, Charles Yeomans wrote:
On Feb 16, 2007, at 1:04 PM, [EMAIL PROTECTED] wrote:
How would I go about determining if a given folderitem is an
executable file? This only has to work on OSX (10.3+).
It depends on what you mean. Other people have said how to tell
whether the file has execute permissions set. But those can be set
for any file. If, on the other hand, you want to know how to tell
whether a file consists of executable code, then that's a little
more difficult. If the first eight bytes of the file are 'Joy!
peff', then it is probably a PEF executable. Mach-O executables
also begin with a header whose structure is documented in Apple's
Mach-O docs, but I don't know offhand an easy test for Mach-O format.
One of the other tricks is that for Unix if you set the executable
bit on a directory that means something slightly different than the
executable bit for a file
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>