[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-Toolbox] Determining a full path to the currentfolder



At 0:26 -0400 1999.09.13, Ronald J Kimball wrote:
>On Sun, Sep 12, 1999 at 11:17:16PM -0500, Walter Torres wrote:
>> Sure, that works, but so does this...
>>
>> # Remove the file name from the complete path
>> # Win32, MacOS & UNIX compliant
>> ( $scriptPath = $0 ) =~ s{[^\\\/:]*$}{};
>>
>> Just my 2 cents
>>
>
>That's not compliant on any of those systems.
>
>\ and / are legal in filenames on the Mac, and : is legal in filenames on
>Windows and Unix.

In addition, there are other path separators.  Some systems use . as a
separator.  Just easier to use the standard library, then you don't need to
do the thinking, because I don't know who -- if anyone -- could on the spot
write a regex or function to account for all possibilities.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-toolbox-request@macperl.org