realpath madness

John Hughes <[email protected]>
Newsgroups gmane.linux.cluster.ssic.devel
Message-ID <[email protected]>
Well, I've been bitten for the nth time by realpath(3)'s inability to 
understand context dependent symlinks (cdsl's).

(In this case it's sound-juicer trying to open the cdrom device).

So I propose to modify libc's realpath.

The dumb way would be to make libc depend on libcluster - but that seems 
insane, and hard.

So how to resolve cdsl's without using libcluster?

Well, it's easy, just make a cdsl:

/cluster/symlink -> /cluster/node{nodenum}/symlink/

and in /cluster/nodeXXX/symlink we have files containing the values of 
all the {xxx} things cdsl's can have,

i.e. /cluster/node6/symlink/nodenum contains "6".

realpath calls an "expand_cdsl" function after reading a symlink, which 
replaces {xxx} by the contents of /cluster/symlink/xxx (which is really 
/cluster/nodeXXX/symlink/xxx).

This even fixes a bug in my earlier ssi_realpath implementation - the 
"{nodenum}" we want is *not* the current nodenum, it's the "context" 
nodenum.

Testing underway.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.