|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Directory link
Hello,
I'm trying to create a link to a directory. I have looked @ the man pages but no joy. pwd /usr/local/www/data/ ln -fh testarea /home/user/testarea link: testarea: Is a directory with in -fhs testarea /home/user/testarea that seems to work but when I access the link I run into this error /home/user/testarea: Too many levels of symbolic links. Thanks in advance! |
|
#2
|
|||
|
|||
|
Wait, you're creating the link _to_ the directory? You've got your arguments backwards. ("ln creates a link to an existing file source_file. If target_file is given, the link has that name ....")
The man page is confusing as hell. "target_file" and "target_directory" should be replaced throughout with "link_name" or some such. Regarding the first error you were getting, directories cannot be hard linked, only symbolically linked. K.C. |
|
#3
|
|||
|
|||
|
Thank you for your reply.
So how would I go about creating a link to a directory? |
|
#4
|
|||
|
|||
|
One would create a link to a directory like this :
ln -s /path/to/realdir [name_of_link] The name of the link is optional; without it the link name will be the same as the "source" file or directory. In this case, "realdir". So, in your case, the following should be sufficient (if I am guessing your intentions correctly) : cd /usr/local/www/data/ ln -s /home/user/testarea ... which would leave you with a link in /usr/local/www/data/ that looks like a subdirectory named testarea and points to the actual subdirectory /home/user/testarea . K.C. |
|
#5
|
|||
|
|||
|
That did it..... thanks!
|
|
#6
|
|||
|
|||
|
Only 2 and half years late
![]() But still a solution. I wanted the directory linking from a location to a users ftp home folder, but using symlink the links were not available in ftp, whether this was the ftp server hidding them or not I'm not sure. But found a nice method using the mount command, this allowed me to create a link between the destination and was also available in FTP clients. mount --bind <DESTINATION> <NEW FOLDER> This is only available till next restart, to have the mounted directory available after restart, add the following line to your /etc/fstab file <DESTINATION> <NEW FOLDER> none bind
__________________
regards, pgudge Last edited by pgudge : September 27th, 2005 at 10:44 AM. Reason: added fstab info |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > BSD Help > Directory link |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|