delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/08/26/17:32:43

From: W DOT Hennings AT fz-juelich DOT de (Wilfried Hennings)
Subject: B19: How to read dos (crlf) text files?
26 Aug 1998 17:32:43 -0700 :
Message-ID: <199808250754.JAA20747.cygnus.gnu-win32@fz-juelich.de>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

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 DOT Hennings AT fz-juelich DOT 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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


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