Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 1
    This answers your question: unix, difference between path starting with '/' and '//' Commented Oct 11, 2021 at 20:38
  • @ThomasDickey Sort of! In the answer, the user says "but ///foo is equivalent to /foo", but you can see in my note that /// is not a valid file path. Why is this? is the answer wrong, or are there special cases? Commented Oct 11, 2021 at 20:42
  • Also; in this answer, the user mentions behavior relating to a 'implementation-defined manner'. what sort of behaviors can I expect? unix.stackexchange.com/a/12284/459032 Commented Oct 11, 2021 at 20:44
  • 2
    @tuskiomi: "implementation-defined" is a standard formulation in specifications (it features heavily in C and C++ for example) and means exactly what it sounds like: the behavior is defined by the implementation and the standard does not say anything about what that behavior may be. So, Linux could launch a nuclear missile when you cd // whereas macOS could brick your computer, FreeBSD could do nothing at all, NetBSD could treat it as /, Solaris could use it for file sharing, HP-UX could use it for accessing windows on the desktop, … Commented Oct 11, 2021 at 20:48
  • 1
    @tuskiomi: No, you are thinking of "undefined behavior". "Implementation-defined behavior" is well-defined and predictable, it's just defined in the manual of the implementation rather than the standard. And thus different on different implementations, but consistent on one implementation. Undefined behavior is not required to be consistent even on the same implementation, and in fact, implementations take advantage of that: when a user invokes undefined behavior, the implementation will often assume that behavior to be whatever is fastest. Commented Oct 11, 2021 at 20:56