Throughout the POSIX specification, there's provision (1, 2, 3...) to allow implementations to treat a path starting with two /
specially.
A POSIX application (an application written to the POSIX specification to be portable to all POSIX compliant systems) cannot assume that //foo/bar
is the same as /foo/bar
(though they can assume that ///foo/bar
is the same as /foo/bar
).
Now what are those POSIX systems (historical and still maintained) that treat //foo
specially? I believed (I've now been proven wrong) that POSIX provision was pushed by Microsoft for their Unix variant (XENIX) and possibly Windows POSIX layer (can anyone confirm that?).
It is used by Cygwin which also is a POSIX-like layer for Microsoft Windows. Are there any non-Microsoft Windows systems? OpenVMS?
On systems where //foo/bar
is special, what is it used for? //host/path
for network file systems access? Virtual file systems?
Do some applications running on Unix-likes —if not the system's API— treat //foo/bar
paths specially (in contexts where they otherwise treat /foo/bar
as the path on the filesystem)?
Edit, I've since asked a question on the austin-group mailing list about the origin of //foo/bar
handling in the spec, and the discussion is an interesting read (from an archaeology point of view at least).
ls -ld //
displaysd..... //
instead ofd..... /
: is it one of the side effect you are looking for ? – Olivier Dulac Jan 20 '16 at 12:08ls -ld ///
would also display///
,ls
just displays the file it is being told to display as it was given. I'm looking for systems or applications that treat //foo/var specially (not as a path on the filesystem) like Cygwin does. – Stéphane Chazelas Jan 20 '16 at 12:14/boot/grub
and//boot/grub
and///boot/grub
and//////////////////////////////////////////////////////////////////////////////////boot/grub
are all the same according to a range of applications. – cat Jan 20 '16 at 12:54IBM's z/OS resolves //pathname requests to MVS datasets (as opposed to the hierarchical filesystem (HFS)) (......) Additionally, z/OS would not accept or recognize additional "directory" or "file" components appended to such paths.
... not exactly unix, though ^^). – Olivier Dulac Jan 20 '16 at 16:10cd /
(or just/
) is whatcd ..
is for Unix. So AmigaOS would interpret/foo/bar
as Unix wouldcd ../foo/bar
, and//foo/bar
as Unix wouldcd ../../foo/bar
. (The filesystem root would be:
.) – DevSolar Jan 20 '16 at 16:20\\
is a UNC path, but Windows doesn't follow POSIX (nor claim to). – user253751 Jan 20 '16 at 19:11///foo/bar
is the same as/foo/bar
then why on Linux, chromium would open a image file asfile:///home/edward/Pictures/arch-wallpaper.png
? (note the starting three slashes) – Alex Jones Jan 20 '16 at 22:28file://
, alike tohttp://
and such. On chrome here at work a windows UNC path that I have open now isfile:////$MACHINE/$SHARENAME/index.html
(although for some reason it also understandsfile://$MACHINE/...
) – admalledd Jan 20 '16 at 23:30//foo
meant accessing some form of remote filestore, global to the network. – vonbrand Jan 25 '16 at 17:58