This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: B19: How to read dos (crlf) text files?


What about doing this:

tr -d '\015' < infile | html2rtf > outfile

I'm assuming that tr.exe is the GNU version the same as in Linux.

Ross

On Tue, 25 Aug 1998, Wilfried Hennings wrote:

> Hello,
> I'm running cygwin32 B19.1 under win95a.
> I take part in developing the latex2rtf converter package
> (previously under the BSD license, now under the GNU license)
> which is being developed under Linux 
> and also compiles and runs ok on a DEC Alpha under DEC OSF/1.
> I now want to get a win32 port of it. 
> It successfully compiles with cygwin32, but if I feed it with
> a dos/win-formatted file (end-of-line = crlf) 
> I get a "read error in line 2".
> If I save the input file in Unix mode (end-of-line = lf),
> it is successfully read.
> Input is via stdin, call is "latex2rtf <infile >outfile"
> 
> YES, I have read the mailing list archive AND also the FAQ.
> 
> NO, I don't want to renew the discussion whether 
> it makes sense to distinguish between text mode and binary.
> 
> I JUST want to get it working.
> 
> The FAQ sais as follows:
> >How is the DOS/Unix CR/LF thing handled?
> >
> >By default, tools that deal with binaries (e.g. objdump) 
> >operate in unix binary mode and tools that
> >deal with text files (e.g. bash) operate in text mode. 
> >
> >You can enable the DOS CR/LF end of line in a text file mode 
> >by setting fmode_binary setting in the registry to 0. 
> 
> I did not find this key. I instead found (among others):
> [HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\
> b15.0\mounts\04]
> "native"="C:"
> "unix"="/"
> "fbinary"=dword:00000000
> "fsilent"=dword:00000000
> 
> Now IS this the required key (obviously it IS set to 0) or not?
> 
> >I've tried to keep the file types 'natural'. 
> >By default a file is opened in text mode.
> >This can be changed by adding O_BINARY 
> >to the second argument of an open call, 
> >or "b" to second argument of an fopen call. 
> >You can also call setmode (fd, O_BINARY). 
> 
> The fopens ARE without the "b" switch.
> 
> What is wrong?
> 
> Thanks for any help,
> 
> Dipl.-Ing. Wilfried Hennings c./o. 
> Forschungszentrum (Research Center) Juelich GmbH, ISR 
> D-52425 Juelich, Germany 
> Tel. (+49) 2461 61 5570 ; Fax (G3+G4) (+49) 2461 61 8254
> email: <W.Hennings@fz-juelich.de>
> my pgp (2.6.3i) public key: <ftp://isr016.isr.kfa-juelich.de/wh.asc>
> ISR homepage: <http://www.kfa-juelich.de/isr/>
> Join the fight against spam!  details at <http://www.cauce.org>
> All opinions mentioned are strictly my own, not my employer's
> 
> -
> For help on using this list (especially unsubscribing), send a message to
> "gnu-win32-request@cygnus.com" with one line of text: "help".
> 

+----------------------+---+
| Ross Johnson         |   | E-Mail: rpj@ise.canberra.edu.au
| Info Sciences and Eng|___|
| University of Canberra   | FAX:    +61 6 2015227
| PO Box 1                 |
| Belconnen  ACT    2616   | WWW:    http://willow.canberra.edu.au/~rpj/
| AUSTRALIA                |
+--------------------------+


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]