Path: utzoo!mnetor!uunet!mcvax!guido From: guido@cwi.nl (Guido van Rossum) Newsgroups: comp.sys.mac.programmer Subject: Re: Full path name of a file Message-ID: <304@piring.cwi.nl> Date: 8 May 88 10:28:22 GMT References: <2532@chalmers.UUCP> <301@piring.cwi.nl> Reply-To: guido@cwi.nl (Guido van Rossum) Organization: The Royal Society for Prevention of Cruelty to Amoebae Lines: 21 I posted a routine to get the full pathname of a file. It had been working for some months. But it still contained a bug, which became apparent when I switched from MPW to LightspeedC this weekend. The parameter to getdirname should be an int, not a long! Also I can now tell you what include files you need for LSC: #include#define NULL 0 Note that it is perfectly legal for a Macintosh owner to create a directory hierarchy where the length of full path names of the deepest files exceeds 255 bytes; since the file system never manipulates full pathnames internally (it only ever sees them when passed as parameters), it doesn't and needn't check. However, this poses an ethical problem if you are constructing full pathnames: my code simply bombs if it would construct a pathname >255 bytes, and if I increased the buffer size, the resulting pathnames are useless except for documentation purposes (since the file system can't have string parameters >255 bytes). -- Guido van Rossum, Centre for Mathematics and Computer Science (CWI), Amsterdam guido@piring.cwi.nl or mcvax!piring!guido or guido%piring.cwi.nl@uunet.uu.net