okay actually I think POSIX filesystem paths and URLs should use different separator characters so people stop writing buggy code that assumes they're interchangeable. they are not interchangeable.


You must log in to comment.

in reply to @nex3's post:

The big differences are:

  1. On some operating systems, \ is valid filesystem path separator. It is never a valid an ambiguously valid (see @easrng's comment below) URL separator.
  2. The canonical form of an absolute URL path begins with file:, which would just be treated as a relative path with a directory name if it were a filesystem path.
  3. Certain characters (such as : or #) are valid in filesystem paths (depending on OS) but not in URL paths.
  4. URL paths may freely write characters as % escape codes, but filesystem paths may not.

Okay I was taking 2 as obvious and not even worthy of consideration—the whole URL is different from the path. For 1, I don’t think that’s true in POSIX, I was considering Windows separately.

But 3 and 4 are very real and I’ve had to deal with them before and wasn’t thinking about them.

On some operating systems, \ is valid filesystem path separator. It is never a valid URL separator.

Actually it's valid according to WHATWG but not IETF which means browsers and non-browsers parse it differently :D