delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/27/03:35:09

Date: Wed, 27 Aug 1997 10:34:42 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Colin Walsh <cwalsh AT nf DOT sympatico DOT ca>
cc: djgpp AT delorie DOT com
Subject: Re: Writing a struct to disk
In-Reply-To: <34033702.0@204.101.95.15>
Message-ID: <Pine.SUN.3.91.970827102829.7942N-100000@is>
MIME-Version: 1.0

On 26 Aug 1997, Colin Walsh wrote:

> > So, if you want a text file to be portable to Unix, you should write
> > it in binary mode on MS-DOS, so it doesn't have those CRs.
> 
> Last night I did up a program to do exactly this (It was to convert a
> Unix mail file into DOS CR/LF text so Eudora could read it).

You should look into your bin subdirectory more often.  DJGPP comes with
such a program already: it is called UTOD (Unix TO Dos) and should be
sitting right there in your bin subdirectory.  There's also an associated
program DTOU for the reverse job.

These two have a nice feature whereby they preserve the timestamps of the
converted files, so programs like Make don't even know the file has been
changed.  They also don't require the second argument (the output file),
since they rewrite the original file, and thus can be used to convert many
files or even whole directory trees with a single command like this:

	 utod dir/.../*

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019