ServerJS/Filesystem API/Join

From MozillaWiki
< ServerJS‎ | Filesystem API
Revision as of 18:52, 13 July 2009 by KrisKowal (talk | contribs) (Called for a show of hands on the "join" features)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Definition

Unit Tests

Show of Hands

A: implicitly uses "normal" to normalize the result, so all empty, ".", and ".." path components are resolved if possible. This is our "normal" definition, which is distinct from "canonical" and "absolute" in that it does not consult the underlying storage or the current working directory.

for: join("foo", "..", "bar") == "bar" and join("..", "foo") == "../foo"

  • Kris Kowal

against: join("foo", "..", "bar") == "foo/../bar"

B: recognizes and follows absolute paths. on a Unix system.

for: join("foo", "/bar") == "/bar"

  • Kris Kowal

against: join("foo", "/bar") == "foo/bar"