[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is / distinct from //?

From: Paul Gilmartin
Subject: Is / distinct from //?
Date: Sun, 17 Dec 2006 11:06:19 -0700 (MST)

Hello, bug-coreutils,

In coreutils-6.7/configure, I read:

        # When cross-compiling, there is no way to tell whether // is specia
        # short of a list of hosts.  However, the only known hosts to date
        # that have a distinct // are Apollo DomainOS (too old to port to)
        # and Cygwin.  If anyone knows of another system for which // has
        # special semantics and is distinct from /, please report it to
        # <address@hidden>.

OK. z/OS (IBM mainframe OS):

    address@hidden:133$ uname -a
    OS/390 MVS3 17.00 03 2066

... is entirely idiosyncratic.  '/' and '//' are treated as identical
by most utilities and system calls:

    address@hidden:134$ ls -di / //
        3 /       3 //

However, fopen(), almost uniquely, and utilities that exploit it
treat them as distinct:

    address@hidden:148$ wc /etc/profile //etc/profile ///etc/profile
        244    1127   10166    /etc/profile
    wc: file "//etc/profile": EDC5047I An invalid file name was specified as a 
function parameter.
        244    1127   10166    ///etc/profile
        488    2254   20332    total

so, one should be cautious using //*.  POSIX advises avoiding the
construct, and using ///* to be safe.

Just thought you'd like to know,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]