Mail Archives: djgpp/2000/11/10/05:10:41
> From: Robin Johnson <robbat2 AT home DOT com>
> Newsgroups: comp.os.msdos.djgpp
> Date: Fri, 10 Nov 2000 01:18:06 GMT
>
> Ok, I'm seriously working on proper *nix versions of these now
You might as well check out the current development version of dtou.c
and utod.c via the anonymous CVS access on DJ's server (see
http://www.delorie.com/djgpp/cvs.html for the details). Andris
Pavenis just submitted patches to make these programs compile and work
on Unix/Linux systems.
> open input file for reading
> (what file open mode should it be in *nix,)
> (as binary doesn't really exist?)
The usual way is to define O_BINARY to zero, if it isn't defined by
fcntl.h, then use it as in "O_RDONLY | O_BINARY".
> with each line
> begin
> read input
> convert all lines as needed
> (what do we do about loose CR's or LF's that are 'out' of
> (place for the expected file?)
Lone CRs should be preserved, otherwise programs which have buffers
with literal unprintable characters will be corrupted.
> get permissions and file time from old file
> set permissions and file time on new file
> (what about the 'owner' of the file?)
You could always use chown to preserve the owner as well, but that
will sometimes fail.
- Raw text -