Cat and Head Problems with Binary Files

Earnie Boyd earnie_boyd@yahoo.com
Sat Jul 31 18:34:00 GMT 1999


--- Jeffry T Ross <jtr@mitre.org> wrote:
> Randy
> 
> I thought the suggestion to use dd was a good, although a bit excessive
> when one only wants to move bytes from a file to a pipe without any
> conversion. So I tried it:
> 
> dd if=test1 > test2
> test1 was 1296 bytes and test2 became 1301 bytes.
> 
> So then I tried dd directly to a file.
> dd if=test1 of=test2
> this worked fine.
> 
> So now I don't suspect cat but the piping and redirection.
> The question is how does cygwin implement it's piping and redirection?
> Is this problem imposed by the underlying WIN/DOS or is it a bug in BASH?
> 
> The pipe shouldn't be trying to interpret the data going through it.
> That's the job of the process at the end of the pipe, be it the terminal
> or another program.
> 
> 
> 
> 							jtr@mitre.org
>  
Hi Jeffry,

What version of cygwin1.dll are you using?  Supply the output of `uname -a' and
I'll know the answer to that.

The stock b20.1 version has a problem with the default behaviors of the 
[no]binary switch for the CYGWIN variable.  If you don't have at least the Jan
15th snapshot then go to the site or mirror and install that version.

The [no]binmode switch affect the processing mode (text vs binary) for pipes
and redirects.  The default is binmode which will pass the \r character through
the pipe and not add the \r character on the redirect.  However, the default
binmode and the specified binmode are different in the stock b20.1 version. 
This created some interesting results.

Good Luck,
===
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't cc me)
_____________________________________________________________
Do You Yahoo!?
Free instant messaging and more at http://messenger.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list