ln-s does not work.. why? (using cygwin in Windows XP)

  • Follow


I am using Windows XP and using cygwin.

For all these years... I was successful to create symbolic links like
this... in the directory /cgydrive/c/x (which is the same as /c/x in
my computer)

Administrator@bfs /c/x
$ ln -s '\\bfs\h$' csprod_h

And, I have a few of those old symlinks... for which I can do like
this:

cd /c/x/csprod_h and I will be taken there.. It still works for the
old symlinks.

But, when I create some new symlinks using the above method... for
example:

Administrator@bfs /c/x
$ ln -s '\\bfs2\c$' cstest_c

All, I get is a..

cstest_c and it is a "system file"... and I can't cd to that
directory.

when i open the file in text editor, this is what i have for example:

!<symlink>=FF=FE\.... with some control characters..

I can't cd to that directory in cygwin nor can i double click on it in
explorer to go to the target directory.

Why the sudden change of behaviour in my system and how can I fix this
problem.

I want symlinks create like above to work.



0
Reply emailsrvr-groups (3) 3/29/2010 4:23:22 AM

On Mar 28, 9:23=A0pm, ihightower <emailsrvr-gro...@yahoo.com> wrote:
> I am using Windows XP and using cygwin.
>
> For all these years... I was successful to create symbolic links like
> this... in the directory /cgydrive/c/x (which is the same as /c/x in
> my computer)
>
> Administrator@bfs /c/x
> $ ln -s '\\bfs\h$' csprod_h
>
> And, I have a few of those old symlinks... for which I can do like
> this:
>
> cd /c/x/csprod_h and I will be taken there.. It still works for the
> old symlinks.
>
> But, when I create some new symlinks using the above method... for
> example:
>
> Administrator@bfs /c/x
> $ ln -s '\\bfs2\c$' cstest_c
>
> All, I get is a..
>
> cstest_c and it is a "system file"... and I can't cd to that
> directory.
>
> when i open the file in text editor, this is what i have for example:
>
> !<symlink>=FF=FE\.... with some control characters..
>
> I can't cd to that directory in cygwin nor can i double click on it in
> explorer to go to the target directory.
>
> Why the sudden change of behaviour in my system and how can I fix this
> problem.
>
> I want symlinks create like above to work.

Possibly because the directory you are pointing to does not exist?

Perhaps you meant to use forward slashes, not back slashes.
Cygwin takes Unix-like directory names, not Windows-like.
--
Fred K
0
Reply Fred 3/29/2010 2:25:21 PM


Fred wrote:

> ihightower wrote:
>> I am using Windows XP and using cygwin.
>>
>> For all these years... I was successful to create symbolic links like
>> this... in the directory /cgydrive/c/x (which is the same as /c/x in
>> my computer)
>> [...]
>> But, when I create some new symlinks using the above method... for
>> example:
>>
>> Administrator@bfs /c/x
>> $ ln -s '\\bfs2\c$' cstest_c
>>
>> All, I get is a..
>>
>> cstest_c and it is a "system file"... and I can't cd to that
>> directory.
>>
>> when i open the file in text editor, this is what i have for example:
>>
>> !<symlink>ÿþ\.... with some control characters..

Looks OK.

>> I can't cd to that directory in cygwin nor can i double click on it in
>> explorer to go to the target directory.

What does

  ls --color -l

or

  readlink cstest_c

tell you?

>> Why the sudden change of behaviour in my system and how can I fix this
>> problem.
>>
>> I want symlinks create like above to work.
> 
> Possibly because the directory you are pointing to does not exist?
> 
> Perhaps you meant to use forward slashes, not back slashes.
> Cygwin takes Unix-like directory names, not Windows-like.

Not true, it used to support both, so that

  ln -s 'C:\foo' bar

was equivalent to

  ln -s /cygdrive/c/foo bar

But perhaps

  ln -s '\\bfs2\C$' cstest_c

(capital C) works (I have never created symlinks to network shares without 
an assigned drive letter).  An alternative would be to try

  ln -s '\\\\bfs2\\c$' cstest_c

Maybe something became buggy with the expansion of escape sequences in 
single-quoted strings.  (The OP should really try the Cygwin support 
first.)


PointedEars
0
Reply Thomas 3/29/2010 4:50:51 PM

On Mar 29, 11:50=A0pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
> Fred wrote:
> >ihightowerwrote:
> >> I am using Windows XP and using cygwin.
>
> >> For all these years... I was successful to create symbolic links like
> >> this... in the directory /cgydrive/c/x (which is the same as /c/x in
> >> my computer)
> >> [...]
> >> But, when I create some new symlinks using the above method... for
> >> example:
>
> >> Administrator@bfs /c/x
> >> $ ln -s '\\bfs2\c$' cstest_c
>
> >> All, I get is a..
>
> >> cstest_c and it is a "system file"... and I can't cd to that
> >> directory.
>
> >> when i open the file in text editor, this is what i have for example:
>
> >> !<symlink>=FF=FE\.... with some control characters..
>
> Looks OK.
>
> >> I can't cd to that directory in cygwin nor can i double click on it in
> >> explorer to go to the target directory.
>
> What does
>
> =A0 ls --color -l
>
> or
>
> =A0 readlink cstest_c
>
> tell you?
>
> >> Why the sudden change of behaviour in my system and how can I fix this
> >> problem.
>
> >> I want symlinks create like above to work.
>
> > Possibly because the directory you are pointing to does not exist?
>
> > Perhaps you meant to use forward slashes, not back slashes.
> > Cygwin takes Unix-like directory names, not Windows-like.
>
> Not true, it used to support both, so that
>
> =A0 ln -s 'C:\foo' bar
>
> was equivalent to
>
> =A0 ln -s /cygdrive/c/foo bar
>
> But perhaps
>
> =A0 ln -s '\\bfs2\C$' cstest_c
>
> (capital C) works (I have never created symlinks to network shares withou=
t
> an assigned drive letter). =A0An alternative would be to try
>
> =A0 ln -s '\\\\bfs2\\c$' cstest_c
>
> Maybe something became buggy with the expansion of escape sequences in
> single-quoted strings. =A0(The OP should really try the Cygwin support
> first.)
>
> PointedEars

Thank you for your reply.. But, still not work with all your
suggestions..

I have made sure that I can cd to the directory and verified it. Even
did cd to a local directory (not in share)...

ln -s '/cygdrive/c/TEST/' test_f

this creates a system file too... and i can't double click or cd to
there.

i tried both of your tests... and this is the result

$ ls --color -l test_f
lrwxrwxrwx 1 Administrator None 17 2010-03-31 17:01 test_f -> /
cygdrive/c/Test//

$ readlink test_f
/cygdrive/c/Test/

but as i said.. in windows explorer.. it says..

test_f    1KB         System file

while all my other earlier symbolic links are

itshare     1KB      Shortcut


??????????????totally confused.




The director exists..
0
Reply ihightower 3/31/2010 10:13:05 AM

ihightower wrote:

> I have made sure that I can cd to the directory and verified it. Even
> did cd to a local directory (not in share)...
> 
> ln -s '/cygdrive/c/TEST/' test_f

Maybe you should not single-quote the target path?
 
> this creates a system file too... and i can't double click or cd to
> there.
> 
> i tried both of your tests... and this is the result
> 
> $ ls --color -l test_f
> lrwxrwxrwx 1 Administrator None 17 2010-03-31 17:01 test_f -> /
> cygdrive/c/Test//

ISTM that because of the single-quoting there's an extra `/' now, so that 
might as well be the problem.  (I have not used Cygwin since half a year, I 
like real GNU/Linux better :))
 
> $ readlink test_f
> /cygdrive/c/Test/

That's a bit weird, though.  Why should there be an extra slash above and 
not here?  Have you aliased `ls' to `ls -p' or `ls -F'?

> but as i said.. in windows explorer.. it says..
> 
> test_f    1KB         System file
> 
> while all my other earlier symbolic links are
> 
> itshare     1KB      Shortcut

The File Type column is rather meaningless in Windows Explorer.  You need 
to enable the display of filename extensions for the first column to see 
what is really going on.  "Shortcuts" should have the suffix .LNK, "System 
files" would not.

> ??????????????totally confused.

Your Question Mark key is borken.

Please trim your quotes to the relevant minimum next time.


PointedEars
0
Reply Thomas 3/31/2010 7:28:48 PM

On Apr 1, 2:28=A0am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
> ihightowerwrote:
> > I have made sure that I can cd to the directory and verified it. Even
> > did cd to a local directory (not in share)...
>
> > ln -s '/cygdrive/c/TEST/' test_f
>
> Maybe you should not single-quote the target path?
>
> > this creates a system file too... and i can't double click or cd to
> > there.
>
> > i tried both of your tests... and this is the result
>
> > $ ls --color -l test_f
> > lrwxrwxrwx 1 Administrator None 17 2010-03-31 17:01 test_f -> /
> > cygdrive/c/Test//
>
> ISTM that because of the single-quoting there's an extra `/' now, so that
> might as well be the problem. =A0(I have not used Cygwin since half a yea=
r, I
> like real GNU/Linux better :))
>
> > $ readlink test_f
> > /cygdrive/c/Test/
>
> That's a bit weird, though. =A0Why should there be an extra slash above a=
nd
> not here? =A0Have you aliased `ls' to `ls -p' or `ls -F'?
>
> > but as i said.. in windows explorer.. it says..
>
> > test_f =A0 =A01KB =A0 =A0 =A0 =A0 System file
>
> > while all my other earlier symbolic links are
>
> > itshare =A0 =A0 1KB =A0 =A0 =A0Shortcut
>
> The File Type column is rather meaningless in Windows Explorer. =A0You ne=
ed
> to enable the display of filename extensions for the first column to see
> what is really going on. =A0"Shortcuts" should have the suffix .LNK, "Sys=
tem
> files" would not.
>
> > ??????????????totally confused.
>
> Your Question Mark key is borken.
>
> Please trim your quotes to the relevant minimum next time.
>
> PointedEars

Tried various options as per your recommendations.. but still no
avail...

In Windows Explorer... extensions will be shown.. but for shortcuts..
it doesn't appear.. all other files will show extension... e.g.
text.xls test.php ,etc

This is what I have..

Administrator@BFSCILAP22 /cygdrive/c/x
$ ln -s /cygdrive/c/Test test_f

Administrator@BFSCILAP22 /cygdrive/c/x
$ readlink test_f
/cygdrive/c/Test

Administrator@BFSCILAP22 /cygdrive/c/x
$ ls --color -l test_f
lrwxrwxrwx 1 Administrator None 16 2010-04-05 15:33 test_f -> /
cygdrive/c/Test/

Administrator@BFSCILAP22 /cygdrive/c/x
$

And, in Windows Explorer... when I double click.. it just opens up a
"Open With" dialog box.. with a list of all installed applications. It
says "System File" and also no extension.

I have other shortcuts which were created months earlier (using the
same approach).. and that works very well... only I can't create any
more new ones..

Someone please help.
0
Reply ihightower 4/5/2010 8:39:45 AM

On 2010-04-05, ihightower <emailsrvr-groups@yahoo.com> wrote:
>
> And, in Windows Explorer... when I double click.. it just opens up a
> "Open With" dialog box.. with a list of all installed applications. It
> says "System File" and also no extension.
>
> I have other shortcuts which were created months earlier (using the
> same approach).. and that works very well... only I can't create any
> more new ones..
>
> Someone please help.

Have you tried reinstalling cygwin?

0
Reply Bill 4/5/2010 6:03:51 PM

On Apr 6, 1:03=A0am, Bill Marcum <b...@lat.localnet> wrote:
> On 2010-04-05,ihightower<emailsrvr-gro...@yahoo.com> wrote:
>
>
>
> > And, in Windows Explorer... when I double click.. it just opens up a
> > "Open With" dialog box.. with a list of all installed applications. It
> > says "System File" and also no extension.
>
> > I have other shortcuts which were created months earlier (using the
> > same approach).. and that works very well... only I can't create any
> > more new ones..
>
> > Someone please help.
>
> Have you tried reinstalling cygwin?

Thank you for the reply.. and I did the following to make it partly
work..

I didn't complete reinstall cygwin... but i just ran the setup.exe..
and reinstalled bash, and other coreutils.. i just picked a few items
(for reinstallation) on my own which i think related to this..

Then, started up cygwin...

This time... I can cd to the symlink from cygwin... works good now.

But, still in Windows, I can't double click on the symlink to take me
to the directory and it still shows as a "System File".

Any further pointers...??

0
Reply ihightower 4/7/2010 4:12:36 AM

7 Replies
1541 Views

(page loaded in 0.113 seconds)

Similiar Articles:













7/20/2012 5:38:59 PM


Reply: