3 ms·
While on the subject, what is the difference between file:/path/to/file and file:///path/to/file ? Usually I only see the latter being used.
by kbeckmann 10y ago
While on the subject, what is the difference between file:/path/to/file and file:///path/to/file ? Usually I only see the latter being used.
- vermilingua 10y agoIn file:///, the file:// part signifies the protocol (think http:// http://) and the / in /path/to/file signifies the root directory (think / in /home/user/) I have never seen file:/ used before, so I can't really comment, but it seems invalid to me (and browsers auto-redirect it to ///).
- jameshart 10y agoAlmost. The file: signifies the protocol. The /// is actually //<machinename>/ with an empty machinename as a shorthand for 'localhost'.
- MoSal 10y agoInteresting. Why is this interpreted as a relative path? cd /etc curl file://resolv.conf
- deleted 10y ago[deleted]
- throwanem 10y agoWell, it's ill-formed, so what the UA does with it isn't really specified; cURL presumably treats it as a path relative to . because that's what the developer(s) decided that cURL should do. (For comparison, Firefox transforms it into file:///resolv.conf, then tries to find /resolv.conf on localhost and fails.)