ServerJS/Filesystem API/Join: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
m (→‎Show of Hands: editorial fixes)
Line 11: Line 11:


''against'': <code>join("foo", "..", "bar") == "foo/../bar"</code>
''against'': <code>join("foo", "..", "bar") == "foo/../bar"</code>
*  
* Ash Berlin


'''B''': recognizes and follows absolute paths.
'''B''': recognizes and follows absolute paths.

Revision as of 22:53, 13 July 2009

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"

  • Ash Berlin

B: recognizes and follows absolute paths.

for: join("foo", "/bar") == "/bar" (Unix) join("Foo", "c:\\Bar") == "c:\\Bar" (Microsoft)

  • Kris Kowal

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