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: File paths redirected to MSYS directory


Hi Nathan,

On Mon, Nov 29, 2010 at 9:20 AM, Nathan Rose wrote:
>
> Thanks for your help. I have fixed the Windows path but Cygwin seems to
> be altering it when loading it in to its own $PATH environment variable.
> Compare below, my path as obtained from Windows cmd console and from
> Cygwin. Notice the line 'C:\cygwin\bin' in the first one (end of the second
> line) has been turned in to '/usr/bin' in the second one (end of the third
> line). Why would this be happening? Also, is it a problem that the first two
> entries in the Cygwin path are '/usr/...' rather than '/cygdrive/c/cygwin/usr/...' ?

No, it is not a problem that the first two entries are /usr ...
These are POSIX style paths which Cygwin uses. As it happens, /usr is
the same directory on the disk as /cygdrive/c/cygwin/usr, but /usr is
easier to type :)

Cygwin creates a "make-believe" file system where everything is under
one root directory called "/". In reality, this is the Windows
directory known as C:\cygwin. Everything that belongs to Cygwin lives
under this directory and can be reached starting from the root. As a
convenience to be able to access other drives and and also directories
other than C:\cygwin, all the Windows drives are mounted under
/cygdrive, so for example the "Documents" (My Documents) directory can
be addressed as /cygdrive/c/Users/username/Documents.

As to the difference between the Windows PATH and the Cygwin PATH.

When a Cygwin process starts, it gets the Windows environment which
contains Windows style directories. The Cygwin DLL (which is loaded
into every Cygwin process) converts these into POSIX style (the paths
starting from /cygdrive/c/WINDOWS/System32).

Then, the command interpreter (probably bash) runs its own start-up
scripts. My /etc/profile contains, among others:

PATH=/usr/local/bin:/usr/bin:/bin:$PATH
export PATH

What this does is to set up the PATH with the directories needed for
Cygwin at the front, and then the inherited PATH as a convenience (so
Windows programs can be started from Cygwin prompts, e.g. Notepad).

>
> Windows:
> C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\SYSTEM32\Wbem;C:\Program Files\Novell\
> ZENworks\;C:\Program Files\QuickTime\QTSystem\;C:\MinGW\bin;C:\cygwin\bin;C:\msy
> s\1.0\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Novell\GroupWise;C:\
> Program Files\Putty;C:\GTK\2.0\bin;C:\Program Files\SSH Communications Security\
> SSH Secure Shell;Z:.;Y:.;
>
> Cygwin:
> /usr/local/bin:/usr/bin:/bin:/cygdrive/c/WINDOWS/System32:/cygdrive/c/WINDOWS:/c
> ygdrive/c/WINDOWS/SYSTEM32/Wbem:/cygdrive/c/Program Files/Novell/ZENworks/:/cygd
> rive/c/Program Files/QuickTime/QTSystem/:/cygdrive/c/MinGW/bin:/usr/bin:/cygdriv
> e/c/msys/1.0/bin:/cygdrive/c/Program Files/TortoiseSVN/bin:/cygdrive/c/Program F
> iles/Novell/GroupWise:/cygdrive/c/Program Files/Putty:/cygdrive/c/GTK/2.0/bin:/c
> ygdrive/c/Program Files/SSH Communications Security/SSH Secure Shell:Z:.:Y:.
>


-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

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


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