bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ln -s Bug?


From: Marcus Nutzinger
Subject: ln -s Bug?
Date: Thu, 01 Nov 2007 15:22:58 +0100
User-agent: IceDove 1.5.0.14pre (X11/20071020)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I've implemented an own litte "ln" version the other day and within my
work, I've noticed an interesting behavior in the GNU version: When I
create a new hard link on a file from the current directory, and the
second parameter is a directory, everything works fine, e.g.:

$ ls -l
drwx------ 2 nuuz nuuz 4,0K 2007-11-01 15:13 dir
- -rw------- 1 nuuz nuuz    0 2007-11-01 15:13 file
$ ln file dir/
$ ls -l dir
- -rw------- 1 nuuz nuuz    0 2007-11-01 15:14 file

But if I do the same, just with the -s option to create a symlink, the
following happens:

$ ls -l
drwx------ 2 nuuz nuuz 4,0K 2007-11-01 15:13 dir
- -rw------- 1 nuuz nuuz    0 2007-11-01 15:13 file
$ ln -s file dir/
$ ls -l dir
lrwxrwxrwx 1 nuuz nuuz 1 2007-11-01 15:14 file -> file

So "file" points to itself and not to "../file" as I would expect it
after creating the link.

I've searched the bug-coreutils list but didn't find any bug-report
which asked for the same things, so I post it now. I'm not really sure
if it is a bug, because at least Sun's implementation of "ls" on Solaris
10 works in the same way... If it's fine, could anyone please explain in
a few sentences, why the program behaves in this way?

Greetings,
Marcus Nutzinger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHKeFBeEFjZ1Jaui4RAufcAKChxgo1jSrqAllPiNsxyX0PZSEs7QCdF6gA
sPffmCUcVvIOc/AGXIqjxa8=
=wmCS
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]