[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: binmode
From: |
Tim Van Holder |
Subject: |
Re: binmode |
Date: |
Thu, 20 Sep 2001 16:04:11 +0200 |
> Hence, IMHO, SUPER is totally superfluous: there is no difference.
OK, I'll drop the SUPER.
> Maybe you want to check whether open is asked to open an output or
> input file.
That's what the '$_ =~ /^\b*>/' was for. I suppose I could also use
fcntl, as you suggested, to deduce it after the open. Not sure if
that's necessarily better though.
> There are certainly means to know a posteriori whether a file is used
> as output.
That won't help here:
system ("m4 --blah <in >out");
"out" is never opened as a Perl file, so I can't change it's mode.
Since M4 uses text mode for in- and output (IIRC), this results in
a DOS text file on DOS, resulting in a non-Unix-compatible configure
script. I can either check for the system being dos-djgpp and then
adding a 'system ("dtou out");' (or 'system ("recode /crlf../data out")'
for improved portability), or try some other way of getting Unixy
text. The former is really a hack (possibly a kludge), but the latter
probably involves overhead (in pseudo-perl):
XFile foo("m4 --blah <input |");
my @outputlines = foo->getlines();
print out, @outputlines;
which is probably not very desirable either.
- (no subject), Tim Van Holder, 2001/09/16
- Re: (no subject), Akim Demaille, 2001/09/17
- Re: (no subject), Tim Van Holder, 2001/09/17
- Re: (no subject), Tim Van Holder, 2001/09/17
- Re: (no subject), Akim Demaille, 2001/09/18
- Re: (no subject), Tim Van Holder, 2001/09/18
- Re: (no subject), Akim Demaille, 2001/09/18
- Re: (no subject), Tim Van Holder, 2001/09/18
- Re: binmode, Akim Demaille, 2001/09/19
- Re: binmode, Akim Demaille, 2001/09/19
- Re: binmode,
Tim Van Holder <=
- (no subject), Tim Van Holder, 2001/09/16
- Re: (no subject), Akim Demaille, 2001/09/17
- Re: (no subject), Tim Van Holder, 2001/09/17
- Re: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, Paul Eggert, 2001/09/17
- Re: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, Tim Van Holder, 2001/09/18
- Re: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, Akim Demaille, 2001/09/19