Subject: Re: binary/text files
From: Earnie Boyd <[email-masked]>
To: Aldo Mazzilli <[email-masked]>, [email-masked]
Cc: [email-masked]
Date: Tue, 15 Jun 1999 06:31:13 -0700 (PDT)

--- Aldo Mazzilli <[email-masked]> wrote:
> Hello there,
> 
> can someone tell me how CYGWIN32 handles text and binary files ??
> 
> Especially with :
> 
> - open() call 
> - pipes and sockets
> - tty's and ptys
> - cat() command
> 
> What is the best way to control the case where \r characters are
> inserted in front of each \n.
> 
> The problem is because I have a program which counts the bytes of a
> file, and I have to modifiy it in order to :
> -  count 1 byte at each newline under Unix
> - count 2 bytes at each newline under Win32
> 
> What is the best way to do that ??

First let me say read the documentation and search the archives.  There exists
lots of information on this subject.

Now, to answer the counting problem.  Open the files in O_BINARY or "rb" mode. 
The \r will then be returned as data and the number of characters returned by
the read will be correct.
===
YAWIA,
Earnie Boyd <mailto:[email-masked]>

Newbies, please visit
<http://www.freeyellow.com/members5/gw32/index.html>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

--
Want to unsubscribe from this list?
Send a message to [email-masked]