cygwin unix commands in windows

Eric Blake ebb9@byu.net
Thu Oct 5 02:48:00 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Tom Lee on 10/4/2006 5:45 PM:
> Hello,
> 
> 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
griping.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFJHJ+84KuGfSFAYARAuebAJwPnL9zkIMrnU+tQCSLSiPMGhg3uQCePoOP
MzseCGa1KuXTP5kZKLHfdcY=
=zWJ1
-----END PGP SIGNATURE-----

--
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