This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Hugh Secker-Walker <hsw <at>> 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, 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:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]