Re: links vs real directories



On Mon, Mar 16, 2009 at 11:22:13AM -0400, John Almberg wrote:
I always thought that links to real directories were pretty much the
same as real directories, but I've just discovered a situation where
they are not and I'm wondering if I'm doing something wrong...

A *soft* link to a directory entry (be it a directory or a file or something
else) is not quite equivalent to the original entry since they are easily
distinguished and some programs do treat softlinks differently from other
targets.

A hardlink to a file is exactly equivalent to the original (since the original
directory entry is itself a hardlink). The system does not however allow
you to create hardlinks to directories since it is far too easy to
make Very Bad Things happen that way.



I have a Ruby on Rails application running on a FreeBSD server. All
Rails apps use the same directory structure, that consists of an
application directory, plus a number of subdirectories. One of these
sub directories is called 'config'.

I would like to move this config directory out of the main Rails app
directory, and then add a link from the app directory to the moved
config directory.

so:

app --> config

will become

app --> config(link) --> config

Basically, what I'm doing is:

cd ~/app # now in directory with real 'config' dir
mv config ~/shared/config
ln -s ~/shared/config config

That moves the directory and creates a functional link to it (I
tested it), but Rails doesn't like it and refuses to run the app. The
permissions are correct, I believe:

[master@on:current]> ls -l
total 34
... snip ...
drwxrwxr-x 3 master master 512 Mar 16 11:06 bin
drwxrwxr-x 3 master master 512 Mar 16 11:06 components
lrwxr-xr-x 1 master master 26 Mar 16 11:07 config -> /home/
master/shared/config
drwxr-xr-x 4 master master 512 Mar 16 11:06 db
etc...


So, I guess a link is NOT exactly equivalent to a directory. At least
not the way I am doing it.

I'm guessing I'm making a real newbie mistake, so if anyone can set
me straight, I'd appreciate it.

Thank: John


--
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@xxxxxxxxxxxxx
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • links vs real directories
    ... I always thought that links to real directories were pretty much the same as real directories, but I've just discovered a situation where they are not and I'm wondering if I'm doing something wrong... ... All Rails apps use the same directory structure, that consists of an application directory, plus a number of subdirectories. ... I would like to move this config directory out of the main Rails app directory, and then add a link from the app directory to the moved config directory. ...
    (freebsd-questions)
  • Re: H323 gateway setting in TAPI3
    ... > gateway address via the GUI of netmeeting, ... > the H323 gateway settings and change to my own settings ... > Why not change the H323.TSP configuration to the settings you app requires? ... If two TAPI apps use different H323.TSP config, they will conflit, only one ...
    (microsoft.public.internet.netmeeting)
  • Re: Installing several instances of an app as services
    ... There would be one config file, ... and process to copy that database. ... > at the moment i am developing an app which is sort of an interface to copy ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: H323 gateway setting in TAPI3
    ... > gateway address via the GUI of netmeeting, ... > the H323 gateway settings and change to my own settings ... > Why not change the H323.TSP configuration to the settings you app requires? ... If two TAPI apps use different H323.TSP config, they will conflit, only one ...
    (microsoft.public.win32.programmer.tapi)
  • NewB question on maintaining config files
    ... with app settings that control the behavior of the app on that box. ... We are spending lots of time switching out config settings on those boxes, ...
    (microsoft.public.dotnet.csharp.general)