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: cygwin unix commands in windows

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

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

Eric Blake   
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


Unsubscribe info:
Problem reports:

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