Date: Fri, 10 Nov 2000 12:10:06 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: Robin Johnson Message-Id: <2110-Fri10Nov2000121006+0200-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6 CC: djgpp AT delorie DOT com In-reply-to: <3A0B4CDB.F0708313@home.com> (message from Robin Johnson on Fri, 10 Nov 2000 01:18:06 GMT) Subject: Re: DTOU & UTOD WIP References: <3A0B4CDB DOT F0708313 AT home DOT com> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: Robin Johnson > 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.