Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!apple!claris!drc From: drc@claris.com (Dennis Cohen) Newsgroups: comp.sys.mac.programmer Subject: Re: Full Path Names (Was: Launching application returned in an SFReply record.) Message-ID: <11209@claris.com> Date: 24 Aug 90 13:47:22 GMT References: <25810@cs.yale.edu> <2079@cod.NOSC.MIL> <1990Aug23.154101.12931@efi.com> Organization: Claris Corporation, Santa Clara CA Lines: 32 tim@efi.com (Tim Maroney) writes: >In article <2079@cod.NOSC.MIL> sampson@cod.nosc.mil.UUCP (Charles H. Sampson) writes: >>In article <25810@cs.yale.edu> braun-eric@CS.YALE.EDU (Eric E. Braun) writes: >>> ... Is there any function hidden in IM somplace that returns a full >>>path name given an SFReply? >> >> At least two respondents have given routines that generate the full path >>name. I haven't analyzed them to see if they work (they probably do), but one >>problem with this approach is that the generated path name could theoretically >>be longer than 255 characters (the maximum size of Str255). I doubt that such >>a case would ever arise in the real world. Does anyone know of a case where >>where it did? >Well, no, but folders can nest to any depth. This could happen very >quickly if someone is fond of giving folders names like "The Unbearable >Lightness of Being". I wrote a C routine that at least won't crash in >this case, and with a little work to parse long file names, could cope >with it cleanly: While Tim's code and suggestion will work, the paragraph above is in error. File (and folder) names are limited to 31 chars in length on an HFS volume. As to whether such a case will arise in the "real world", I have encountered it on at least two CD-ROM offerings of PD collections. The disk cataloging utility which I wrote because I didn't like the options available with other offerings handles this case by using CharsHandles instead of Str255s for accumulating the information. -- Dennis Cohen Claris Corp. **************************************************** Disclaimer: Any opinions expressed above are _MINE_!