Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Original Question

Cygwin's CYGWIN environment variable and its contents have effect on several aspects of the Cygwin environment. If CYGWIN contains nodosfilewarning then

Cygwin will warn the first time a user uses an "MS-DOS" style path name rather than a POSIX-style path name

as stated by one of Cygwin FAQ pages.

What is first time? Once a day? Once between computer restarts?

I had set CYGWIN=nodosfilewarning, but still sometimes Cygwin warns me that I use MS-DOS style paths. If I set it to dosfilewarning (and restart my shell) I can't trigger the warning no matter what (like cd C:\\Windows—I assume this is MS-DOS-ish enough).

I don't exactly know if the CYGWIN variable have to be set at OS level or in my Cygwin shell, however I have tried both without success. By without success I mean, if the variable is set to dosfilewarning my assumption is that Cygwin should warn me every time I type something like cd C:\\Windows (which it doesn't do).

How can I verify that I set this stupid variable correctly and my settings are in effect? Cygwin's FAQ gives little help on this particular problem.


Thanks to JdeBP's answer I've managed to come to the following conclusion.

The CYGWIN variable can be set either at OS level or in a Cygwin shell.

cd C:\\Windows doesn't trigger the warning at hand, but ls C:\\Windows does (talk about consistency, huh?).

For now, settings nodosfilewarning really reports no warning for the previously mentioned command, however I originally wrote this post because even though I told Cygwin not to report these warnings it still did sometimes. Unfortunately I don't know when and under what circumstances (I'll update the question if I further encounter these warnings).

share|improve this question
cd is not a program, but a command of the shell. Probably related to that. – Daniel Beck Dec 24 '11 at 7:26
@DanielBeck You're right, but I think one would still expect to trigger the warning nonetheless. – Kohányi Róbert Dec 24 '11 at 7:27
up vote 2 down vote accepted

Every process that uses the Cygwin runtime library maps into that process a portion of shared memory. This contains some data that are shared across all processes using (that particular installation of) the Cygwin runtime library.

One of the flags in that shared memory is the warned_msdos flag. If the warned_msdos flag is false, and if dosfilewarning is set in the CYGWIN environment variable that the process had at process initialization, then you will see the warning. When the warning is issued, the warned_msdos flag is set to true.

Note, importantly:

  • The check won't be made in the first place by any process that had nodosfilewarning.
  • If the check isn't made, warned_msdos will remain set to false.
  • The shared memory stays around until all Cygwin processes using it terminate.
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .