[Python-Dev] Mac questions
Bob Ippolito
bob at redivi.com
Tue Jan 4 11:41:03 CET 2005
On Jan 4, 2005, at 5:00 AM, Thomas Heller wrote:
> I'm working on refactoring Python/import.c, currently the case_ok()
> function.
>
> I was wondering about these lines:
> /* new-fangled macintosh (macosx) */
> #elif defined(__MACH__) && defined(__APPLE__) &&
> defined(HAVE_DIRENT_H)
>
> Is this for Mac OSX? Does the Mac have a case insensitive file system
> (my experiments on the SF compile farm say no)?
Yes, this tests positive for Mac OS X (and probably other variants of
Darwin).
Yes, Mac OS X uses a case preserving but insensitive file system by
default (HFS+), but has case sensitive file systems (UFS, and a case
sensitive version of HFS+, NFS, etc.). The SF compile farm may use one
of these alternative file systems, probably NFS if anything.
> And finally: Is there any other way to find the true spelling of a file
> except than a linear search with opendir()/readdir()/closedir() ?
Yes, definitely. I'm positive you can do this with CoreServices, but
I'm not sure it's portable to Darwin (not Mac OS X). I'm sure there is
some Darwin-compatible way of doing it, but I don't know it off the top
of my head. I'll try to remember to look into it if nobody else finds
it first.
-bob
More information about the Python-Dev
mailing list