1.5.24: incorrect default behavior of dd in popen context on text-mounted filesystem

Eric Blake ebb9@byu.net
Wed Jul 25 18:54:00 GMT 2007


Hugh Secker-Walker <hsw <at> hodain.net> writes:

> My interpretation is thus that when a shell is redirecting
> to a file it will open the in binary mode (because I have
> CYGWIN=binmode).

Explicitly setting CYGWIN=binmode is a no-op.  According to 
http://cygwin.com/cygwin-ug-net/using-cygwinenv.html, CYGWIN already defaults 
to binmode set.  binmode/nobinmode is binary, not ternary.  In short, disk 
files are controlled by mount, all other file descriptors are controlled by 
no/binmode; and except for disk files, there are very few uses of text mode, so 
in general, mount is good enough to trigger any desired text mode processing 
without resorting to changing CYGWIN.

> It seems to me that if the shell(s) were to honor Warning 4 when
> redirecting, then maintainers of individual programs would not have to
> fuss over whether to change the modes of the stdin/stdout fds that
> they've been given.  This puts (or leaves) control in the hands of the
> caller of the executable.

I also maintain bash, and I would rather not have bash inspect the contents of 
the CYGWIN environment variable at every process invocation in order to bypass 
mount settings.  I intend to leave the parsing of the CYGWIN variable to 
cygwin1.dll at process startup, and to let bash honor mount settings as it 
currently does.

-- 
Eric Blake



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list