Quote:
Originally Posted by
solaris_1977
I have Solaris-9, where ndsd application is running. If i grep it, it should three slashed in front of path. Thought everything is working working, but it looks strange, why it is like this.
HTML Code:
root@trim_prt7:/# ps -ef | grep -i ndsd
root 21505 21355 0 08:58:20 pts/23 0:00 grep -i ndsd
root 16238 1 1 08:26:23 ? 30:01 ///opt/novell/eDirectory/sbin/ndsd
root@trim_prt7:/# ls -l /opt/novell/eDirectory/sbin/ndsd
-rwxr-xr-x 1 root bin 514076 May 25 2006 /opt/novell/eDirectory/sbin/ndsd
On Solaris, any number of leading slash characters will resolve to the same path as if there is just one leading slash (unless the extra characters make the path longer than PATH_MAX).
Some applications insert two extra slashes at the start of a pathname to simplify internal logic when combining various pathname components into a complete pathname. The standards allow a pathname that starts with
exactly two leading slashes to be treated specially. (Some implementations treat two leading slashes as a reference to a super-root such that
//node/pathname resolves to the file with the absolute pathname specified by
/pathname on the machine on the local network with nodename
node.) Therefore, portable applications should be sure that they never create a pathname for a local file that starts with two slashes.
In case some people reading this thread didn't know, you usually see a single slash between directories in a pathname, but (again, other than string length requirements) the pathnames
a/b,
a//b,
a///b, and, in fact,
a followed by any positive number of / characters followed by
b all are required to resolve to the same file.
When an application is given a directory name and a filename and combines them into a pathname by concatenating a directory name, a slash, and a filename to produce a pathname, the application won't get the right file if the directory given is the root directory (/) and it is running on a system that supports the super-root extension. But, if it combines them into a pathname by concatenating the directory name, two slash characters, and the filename; it will always work as expected (since if the root directory is the given directory, the combined pathname will start with /// instead of //).