From: Louis J Scoras Date: 2005-09-30T21:35:14+09:00 Subject: Re: [Q] creating hard links for Directories. ------=_Part_1868_24122067.1128083710737 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 9/30/05, kraf001 wrote: > > well the problem is when I use symbolic links, it gives me a new director= y > with a file in it... this file has the same name as the direcoty I was > trying to link... but the direcotry created doesn't have the same content > of the linked directory! How are you calling this? Here's an example that might help: You have a directory you want to link... ljs@kontiki ~/foo $ ls -l total 0 drwxr-xr-x 2 ljs ljs 192 2005-09-30 08:19 bar with some files in it... ljs@kontiki ~/foo $ ls -l bar total 24 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file0 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file1 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file2 use the 'File.symlink' method to create the link... ljs@kontiki ~/foo $ ruby -e 'File.symlink("bar","baz")' and the link is created. ljs@kontiki ~/foo $ ls -l total 0 drwxr-xr-x 2 ljs ljs 192 2005-09-30 08:19 bar lrwxrwxrwx 1 ljs ljs 3 2005-09-30 08:23 baz -> bar The original directory is there... ljs@kontiki ~/foo $ ls -l bar total 24 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file0 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file1 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file2 and the new link points to it. ljs@kontiki ~/foo $ ls -lH baz total 24 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file0 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file1 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file2 Create a new file under the link: ljs@kontiki ~/foo $ echo data > baz/new_file and it goes into the orignal directory ljs@kontiki ~/foo $ ls -l bar total 28 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file0 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file1 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:18 file2 -rw-r--r-- 1 ljs ljs 5 2005-09-30 08:23 new_file file can be referenced from the orignal path ljs@kontiki ~/foo $ cat bar/new_file data It should also work the other way around. Hope this was helpful and not overly long winded or pedantic. Also I hope this pertains to your OS: This was run on Ubuntu Hoary. -- Lou ------=_Part_1868_24122067.1128083710737--