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: ln -s do not work


On 2013-04-20, Arthur Tu wrote:
> After I did this:
> $ ln -s Repos/bugn/ Projects/
> 
> A file named `bugn` is created under Projects,
> as it is said in the cygwin documentation.
> 
> However, cygwin does recognise `bugn` as a link file,
> while can't determine where it point to.
> 
> I draged the file to notepad.exe, and see following text:
> 
> !<symlink>ïî e p o s / b u g n /
> 
> 
> $ cygcheck -f /bin/ln.exe
> coreutils-8.15-1
> 
> I am sure `ln -s some_directory` used to work well on my computer.
> I tested hard link or soft link of the file, it worked well.
> Help.

This is not a Cygwin problem.  Linux, for example, behaves the same.

What you did was create a symbolic link in Projects to the file
named Repos/bugn, a relative path name.  Any reference to
Projects/bugn is resolved to Projects/Repos/bugn.  This is correct,
but not what you intended.

One alternative would be

    $ ln -s ../Repos/bugn/ Projects/

Another would be

    $ ln -s $PWD/Repos/bugn/ Projects/

Which one is better depends on your environment and on what you're
trying to achieve.

Regards,
Gary


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


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