This is the mail archive of the
mailing list for the Cygwin project.
Re: cygwin unix commands in windows
- From: Eric Blake <ebb9 at byu dot net>
- To: cygwin at cygwin dot com, tom_lee01 at hotmail dot com
- Date: Wed, 04 Oct 2006 20:48:30 -0600
- Subject: Re: cygwin unix commands in windows
- References: <BAY120-F373EEC2F5FB1C8E2FAA4C38B1D0@phx.gbl>
-----BEGIN PGP SIGNED MESSAGE-----
According to Tom Lee on 10/4/2006 5:45 PM:
> after further study, I noticed that using "c:/directory" works fine with
> my tests except tar.exe.
> I understand people here may like /cygdrive/c more than c:/. Just want
> to know if it is an accident feature that all other commands can work
> with c:/ except tar?
You asked, so I'll answer. Yes, it is an accident that other tools
understand c:/. Cygwin operates on the philosophy that you should use
POSIX paths, aka /cygdrive/c (or if that is too much typing for you, read
'man mount' for how you can shorten it to /c, by remounting cygdrive as
'/'). DOS paths work only when the application is not assigning some
other meaning to the literal colon. ls does not parse its arguments but
hands them straight to stat(), and so it happens to work. tar, on the
other hand, parses its arguments, and treats "c:/dir" as meaning
"directory /dir" on "remote machine c", unless you use tar --force-local.
Another example of a program that parses its arguments is make; you need
only read last months archives for the debate about make 3.80 vs. make
3.81 for proof that using DOS paths in cygwin programs is ASKING for
problems. And yet another case is bash: bash-3.1-8 always opened DOS
paths in binary mode, even though using POSIX paths would open some files
in text mode. Either learn to use POSIX paths if you use cygwin, or quit
Life is short - so eat dessert first!
Eric Blake firstname.lastname@example.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v220.127.116.11 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html