Bug 136373 - Creating symbolic link broken
Summary: Creating symbolic link broken
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: coreutils
Version: 4.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Tim Waugh
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-10-19 16:13 UTC by Thomas Amsler
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-19 16:23:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Thomas Amsler 2004-10-19 16:13:41 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20041001
Firefox/0.10.1

Description of problem:
When creating a symbolic link "ln -s file-name sym-link-name" it
doesn't create a directory but rather a directory. Please see example
output below, where I tried to create 

euler# ln -s jakarta-tomcat-5.0.28 tomcat
euler# ls
eclipse            jakarta-tomcat-5.0.28         maven      thunderbird
firefox-installer  jakarta-tomcat-5.0.28.tar.gz  maven-1.0  tomcat
euler# ll
total 10564
drwxrwxr-x   8 thomas thomas    12288 Oct 19 08:44 .
drwx------  42 thomas thomas     4096 Oct 19 08:44 ..
drwxrwxr-x   6 thomas thomas     4096 Oct 14 08:23 eclipse
drwxr-xr-x  12 thomas thomas     4096 Oct 12 08:35 firefox-installer
drwxrwxr-x  11 thomas thomas     4096 Oct 19 08:44 jakarta-tomcat-5.0.28
-rw-rw-r--   1 thomas thomas 10718313 Oct 15 13:50
jakarta-tomcat-5.0.28.tar.gz
lrwxrwxrwx   1 thomas thomas        9 Oct 18 15:18 maven -> maven-1.0
drwxr-xr-x   5 thomas thomas     4096 Jul 13 06:20 maven-1.0
drwxr-xr-x  10 thomas thomas     4096 Sep 13 05:43 thunderbird
drwxrwxr-x   3 thomas thomas     4096 Oct 19 08:45 tomcat
euler# ll tomcat/
total 36
drwxrwxr-x  3 thomas thomas  4096 Oct 19 08:45 .
drwxrwxr-x  8 thomas thomas 12288 Oct 19 08:44 ..
lrwxrwxrwx  1 thomas thomas    21 Oct 19 08:45 jakarta-tomcat-5.0.28
-> jakarta-tomcat-5.0.28
drwxrwxr-x  3 thomas thomas  4096 Oct 19 08:44 work


Version-Release number of selected component (if applicable):


How reproducible:
Sometimes

Steps to Reproduce:
1. ln -s FileName SymLinkFileName
2.
3.
    

Actual Results:  It creates a folder instead a symbolik link. That
folder always contains  a symlink with the original file name as well
another directory called work.
e.g
ln -s test symtest
ls -la symtest:
test -> test
work

Expected Results:  It should just create a symbolic link:
ln -s test symtest
ls -la symtest
symtest -> test

Additional info:

Comment 1 Tim Waugh 2004-10-19 16:23:05 UTC
The directory was pre-existing.  'ln' doesn't create directories, but if you
specify a directory as the target it will create the symlink inside it.  It's
doing exactly what you asked it to do.


Comment 2 Thomas Amsler 2004-10-19 16:51:27 UTC
The problem is that the directory was not pre-existing. There wasn't a
tomcat directory prior to creating the symbolic link.

Comment 3 Tim Waugh 2004-10-19 16:53:59 UTC
Please try the following shell script:

rm -rf /tmp/arena
mkdir -p /tmp/arena
cd /tmp/arena
touch foo
ln -s foo link
ls -l link

If it shows a directory, please re-open this bug report.


Note You need to log in before you can comment on or make changes to this bug.