public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Earnie Boyd" <earnie_boyd@hotmail.com>
To: ead@ixian.com, gnu-win32@cygnus.com, lhall@rfk.com
Cc: joe@jump.com
Subject: Re: Bug in od, cat, etc reading binary files
Date: Mon, 22 Sep 1997 10:29:00 -0000	[thread overview]
Message-ID: <19970922172829.280.qmail@hotmail.com> (raw)

>Date: Mon, 22 Sep 1997 11:03:56 -0400
>To: Eric De Mund <ead@ixian.com>, GNU-Win32 List <gnu-win32@cygnus.com>
>From: Larry Hall <lhall@rfk.com>
>Subject: Re: Bug in od, cat, etc reading binary files
>Cc: Joe Peterson <joe@jump.com>
>
>At 01:30 AM 9/22/97 -0700, Eric De Mund wrote:
>>GNU-Win32 People,
>>
>>    Joe Peterson <joe@jump.com> to <gnu-win32@cygnus.com>:
>>    ] Sorry if this is documented somewhere, but I could not find
>>    ] mention of it. I find that when, for example, using "od" to look
>>    ] at a binary file, if a ctrl-Z is encountered, the reading stops.
>>    ] This is because the fopen presumably does a "r" rather than a 
"rb"
>>    ] (a pc-ism).
>>    ]
>>    ] Other programs like "cat" and possibly others have this problem 
as
>>    ] well...
>>
>>GNU-Win32 cat(1) does have this problem, as does md5sum(1), rendering
>>them significantly less useful. It's the understanding of this Unix
>>developer new to the Windows world that the equivalent of Microsoft's
>>Visual C++ 5.0 Run-Time Library function _setmode(3) is required 
(global
>>variable _fmode in that development world setting the default file-
>>translation mode of all files *except* stdin, stdout, and stderr).
>>
>>Questions: How do I do these in the GNU-Win32 world? How do I:
>>    * set the analog of MSVC++5.0's _fmode
>>    * call the analog of MSVC++5.0's int _setmode(int handle, int 
mode)
>>
>>Thank you,
>>Eric De Mund
>>
>>"Magazines all too frequently lead to books and should be regarded by 
the
>>prudent as the heavy petting of literature." --Fran Lebowitz
>
>Eric,
>
>You're half right in your understanding.  The problem is due to "text"
>files in Windows and the need to open files in binary mode in order to
>"get things right".  You have 2 choices:
>
>  - Recompile offending code, either setting the mode or changing all
>    file open commands to use the "b" (for binary) flag.
>
>  - mount (via the mount command) your filesystems as binary (-b) so 
that
>    all files are automatically treated as binary just like in UNIX.  
This
>    step is usually the easiest and best in the long run but also tends
>    to cause short term headaches since all the "text" files that you 
>    currently have will be filled with <cr>s which bash and other 
things 
>    will barf on.  Reinstalling the system using cygwin tar/gzip or 
>    translating all your system files (at least) usually handles the 
>    problems.
>
>Larry Hall                              lhall@rfk.com
>RFK Partners, Inc.                      (781) 239-1053
>8 Grove Street                          (781) 239-1655 - FAX
>Wellesley, MA  02181                             
>
>-
>For help on using this list (especially unsubscribing), send a message 
to
>"gnu-win32-request@cygnus.com" with one line of text: "help".
>


Eric,

I chose the second option.  Check the mail archives for further info.

-        \\||//
---o0O0--Earnie--0O0o----
-earnie_boyd@hotmail.com-
------ooo0O--O0ooo-------


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

             reply	other threads:[~1997-09-22 10:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-22 10:29 Earnie Boyd [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-09-30  7:14 Larry Hall
1997-09-30  5:02 Earnie Boyd
1997-09-29 18:48 Earnie Boyd
1997-09-29  7:41 marcus
1997-09-29 18:31 ` Pete Jordan
1997-09-29  7:09 marcus
1997-09-29 13:04 ` Mikey
1997-09-29 18:33 ` justin.
1997-09-27 10:03 Larry Hall
1997-09-26 11:34 Earnie Boyd
1997-09-26  8:42 marcus
1997-09-25  1:22 Eric Mills
1997-09-25  6:23 ` Mikey
1997-09-22  8:15 Larry Hall
1997-09-22  1:30 Eric De Mund
1997-09-08 14:23 Joe Peterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19970922172829.280.qmail@hotmail.com \
    --to=earnie_boyd@hotmail.com \
    --cc=ead@ixian.com \
    --cc=gnu-win32@cygnus.com \
    --cc=joe@jump.com \
    --cc=lhall@rfk.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).