RE: Ls POSIX style slink output

2007-09-20 Thread Matt Seitz (matseitz)
From: Brian Dessent [mailto:[EMAIL PROTECTED] 
 
 Yes, those symlinks in /etc are explicitly created with Win32 
 paths by the base-files postinstall script.  I think the 
 reasoning here is that if a POSIX path were used for the 
 target of the symlink then it would have to be updated if the 
 user ever changed the name of the /cygdrive prefix, whereas 
 just using a Win32 path is always correct and insulates from 
 that variable.

I appreciate your taking the time to read my suggestion and respond so
quickly with such a complete clear and complete explanation.  

As an alternative suggestion, how about using forward slashes instead of
backwards slashes (C:/windows/system32/drivers/etc/hosts) in the
base-files postinstall script?  That would allow pasting the ls -l
ouput to cd, without using the riskier /cygdrive prefix.

--
Matt Seitz
Manager, File System Virtualization
Cisco Systems, Inc.
.:|:.:|:.  

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



Re: Ls POSIX style slink output

2007-09-20 Thread Brian Dessent
Matt Seitz (matseitz) wrote:

 I appreciate your taking the time to read my suggestion and respond so
 quickly with such a complete clear and complete explanation.
 
 As an alternative suggestion, how about using forward slashes instead of
 backwards slashes (C:/windows/system32/drivers/etc/hosts) in the
 base-files postinstall script?  That would allow pasting the ls -l
 ouput to cd, without using the riskier /cygdrive prefix.

That would be up to the base-files package maintainer, however I don't
think it's necessary.  As I said the current DLL code already normalizes
symlink targets so if you use a snapshot you will see those links in
POSIX form with ls -l even though they're stored on disk as Win32
paths.  If you want a temporary local fix that doesn't involve using a
snapshot you can just recreate the links in any form you want, as the
base-files postinstall will not overwrite or recreate them if they
exist.

Brian

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



RE: Ls POSIX style slink output

2007-09-20 Thread Matt Seitz (matseitz)
From: Brian Dessent [mailto:[EMAIL PROTECTED] 
 
 That would be up to the base-files package maintainer, 
 however I don't think it's necessary.  As I said the current 
 DLL code already normalizes symlink targets so if you use a 
 snapshot you will see those links in POSIX form with ls -l 
 even though they're stored on disk as Win32 paths.  

Good point. I'll look forward to the new release, and just use your
suggested workaround for now.  Thank you again for your help.

--
Matt Seitz
Manager, File System Virtualization
Cisco Systems, Inc.
.:|:.:|:.  

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



Re: Ls POSIX style slink output

2007-09-19 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Matt Seitz (matseitz) on 9/19/2007 5:32 PM:
 What do you think of changing ls -l to display symbolic links using
 POSIX style paths instead of Windows style?
 
 When I run ls -l /etc, the symbolic links are displayed using Windows
 format (C:\WINDOWS\system32\drivers\etc\hosts).  It would be easier to
 copy and paste the output to a cd command if ls -l displayed a POSIX
 style path (/cygdrive/c/WINDOWS/system32/drivers/etc/hosts).

Symlinks merely contain whatever text they were created with.  If the text
it was created with was Windows style, then readlink(2) will not translate
it.  I suppose I could try to patch ln(1) to posix-ify any name that looks
like a Windows filename before actually calling symlink(2), but I'm not
sure it buys much.  So for now, it's a feature, not a bug.

- --
Don't work too hard, make some time for fun as well!

Eric Blake [EMAIL PROTECTED]
volunteer cygwin coreutils maintainer
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG8ccS84KuGfSFAYARAiOFAJ0URAAePBKMruh7nJ6Es6jalbTGTQCeLeVE
lb9xV3saURobKFO1VcP1wqU=
=z5Kf
-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/



Re: Ls POSIX style slink output

2007-09-19 Thread Brian Dessent
Eric Blake wrote:

 Symlinks merely contain whatever text they were created with.  If the text
 it was created with was Windows style, then readlink(2) will not translate
 it.  I suppose I could try to patch ln(1) to posix-ify any name that looks
 like a Windows filename before actually calling symlink(2), but I'm not
 sure it buys much.  So for now, it's a feature, not a bug.

Yes, those symlinks in /etc are explicitly created with Win32 paths by
the base-files postinstall script.  I think the reasoning here is that
if a POSIX path were used for the target of the symlink then it would
have to be updated if the user ever changed the name of the /cygdrive
prefix, whereas just using a Win32 path is always correct and insulates
from that variable.

Moreover, I think recent versions of the Cygwin DLL (i.e. 1.7/HEAD) do
in fact normalize the target to be in POSIX form when reading the
contents of the symlink file.  I seem to recall a headsup from Corinna
about this a while ago.  This means no special accomodations are needed
in 'ls'.

Brian

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