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

Re: [MacPerl] open() misfeature?



"Paul J. Schinder" <schinder@pjstoaster.pg.md.us> writes:
>Matthias Ulrich Neeracher <neeri@iis.ee.ethz.ch> writes:
>}h0444zkf@rz.hu-berlin.de (Erich Rast) writes:
>}># Can't open ' Mac:Desktop Folder:index.html': Invalid argument
>}
>}Yes, open() is documented to ignore leading & trailing spaces. IO::File shoul
d
>}be able to open spaced out files.

>[Paul points out that IO::File.pm as distributed in 5.1.3 is buggy and
> furthermore does not solve the problem]

As usual, Paul is right. However, I now *do* have a solution to offer: the
sysopen() function doesn't do funny things to arguments, i.e.

use Fcntl;

sysopen(FILE, ' Mac:Desktop Folder:index.html', O_RDONLY)

should do the trick.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
       "You can get much farther with a kind word and a gun
        than you can with a kind word alone." -- Al Capone