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

Re: [MacPerl] File name bug with open.



At 9:39 PM -0700 9/12/97, Paul J. Schinder wrote:
>Brian Eaton <pewter@ibm.net> writes:
>}Ran across this while working on the standalone I mentioned before - it may
>}have already been reported.  Open (apparently) discards the space on the
>}end of filenames, even though Mac OS allows spaces anywhere in a filename.
>}The workaround is fairly simple, as rename doesn't contain the same bug.
>
>Not a bug, a documented feature of open.  Whitespace is stripped of both
>ends of the filename, so if you want it, you need to protect it.  The
>easiest way to deal with it at the end of the name is open(FILE,"$file\0").
>Alternatively, you can use either FileHandle or IO::File, where the open
>method protects whitespace on both ends.
>
>Start up Shuck, choose "Builtin Functions" from the Go menu, and read the
>section on open().
>

Whaddya know?  It is supposed to act like that!  I never for a second
thought behavior that weird could be a feature.  Thanks Paul.  Just out of
curiousity, does anybody know why open() does this?

- Brian



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch