I know the MacOS module is deprecated, and now I know at least one
detail of "why":
If I use MacOS.GetCreatorAndType(filename) on my Intel machine, I get
for an EPS:
('09HF', 'FSPE')
That should read ('FH09', 'EPSF').
I didn't knew endian-ness affects the order of strings.
Very funny! ;-)
I think the modern Mac equivalent goes something like this:
def uti_for_file(path):
import os
from AppKit import NSWorkspace
uti, err = NSWorkspace.sharedWorkspace().typeOfFile_error_(
os.path.realpath(path), None)
if err:
raise Exception(unicode(err))
else:
Am 2008-11-29 um 20:15 schrieb Bill Janssen:
I think the modern Mac equivalent goes something like this:
def uti_for_file(path):
import os
from AppKit import NSWorkspace
uti, err = NSWorkspace.sharedWorkspace().typeOfFile_error_(
os.path.realpath(path), None)
if err: