SunQuest
           BSD Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsBSD Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old March 27th, 2003, 12:52 PM
dfr574 dfr574 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 78 dfr574 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 35 m 14 sec
Reputation Power: 6
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!

Reply With Quote
  #2  
Old March 27th, 2003, 11:39 PM
kace kace is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Atlanta
Posts: 9 kace User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m
Reputation Power: 0
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.

Reply With Quote
  #3  
Old March 28th, 2003, 12:14 AM
dfr574 dfr574 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 78 dfr574 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 35 m 14 sec
Reputation Power: 6
Thank you for your reply.

So how would I go about creating a link to a directory?

Reply With Quote
  #4  
Old March 28th, 2003, 10:06 AM
kace kace is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Atlanta
Posts: 9 kace User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 35 m
Reputation Power: 0
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.

Reply With Quote
  #5  
Old March 28th, 2003, 12:01 PM
dfr574 dfr574 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 78 dfr574 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 35 m 14 sec
Reputation Power: 6
That did it..... thanks!

Reply With Quote
  #6  
Old September 27th, 2005, 05:22 AM
pgudge pgudge is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: South Yorkshire
Posts: 435 pgudge User rank is Sergeant (500 - 2000 Reputation Level)pgudge User rank is Sergeant (500 - 2000 Reputation Level)pgudge User rank is Sergeant (500 - 2000 Reputation Level)pgudge User rank is Sergeant (500 - 2000 Reputation Level)pgudge User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 4 h 9 m 22 sec
Reputation Power: 17
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsBSD Help > Directory link


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway