Mail Archives: cygwin/2005/08/26/08:41:34
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 8/26/2005 6:17 AM:
> I also noticed that realpath("c:..", buf) now returns "c:", rather than
> "/cygdrive" - I guess it comes down to the choice of whether cygwin has 2
> roots or 28 roots. I prefer 2 roots (so that the parent directory of any
> drive letter is the cygdrive prefix), but maybe I can be convinced that 28
> is okay. But whatever the choice is, it should be consistent - right now
> realpath("c:/..", buf) is failing with ENOENT, even though it should have
> the same result as realpath("c:..", buf).
Replying to myself, if cygwin is ever changed so that it tracks 27 current
working directories the way Windows does (using the !C: environment
variable and friends), then c:.. and c:/.. would have to have different
semantics. But currently cygwin is documented as implicitly inserting a
path separator after a drive letter, so that all pathnames from a drive
letter start at the root of the drive.
Also, another argument for cygwin to only have 2 roots instead of 28 is
that realpath() is then consistent with getcwd(), and that way, ALL
fully-resolved absolute paths start with '/'. In other words, since
chdir("c:");getcwd(buf, PATH_MAX) returns /cygdrive/c, so should
realpath("c:", buf).
As to your comment in path.cc about realpath(path, NULL) malloc'ing its
result being weird, it is consistent with getcwd(NULL, 0) malloc'ing its
result, and it is quite useful.
- --
Life is short - so eat dessert first!
Eric Blake ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDDw3a84KuGfSFAYARAm43AKCyrAyRRgdD5ziTXFHuBBdQmHDipwCdF8q/
rxekL6Aw70gvyijX3qZXJt8=
=bD2n
-----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/
- Raw text -