Overview
| Artifact ID: | 7d6d4fc87ae796a73e9ca52635a67e9ec2d0b284fd75480519b0994b7cde7ab8 |
|---|---|
| Ticket: | 961646ffffffffffffffffffffffffffffffffff
[file normalize] changes file reference |
| User & Date: | dgp on 2018-06-28 19:06:41 |
Changes
- assignee changed to: "aku"
- closer changed to: "nobody"
- comment changed to:
% glob * file % open noSuchDir/../file couldn't open "noSuchDir/../file": no such file or directory % open [file normalize noSuchDir/../file] file3 Here [file normalize] converts "noSuchDir/../file" to "file", but and [open] on one fails, the other succeeds. I think of [file normalize] giving me the preferred name among many names for one file. Here it is convering a string that names no file into one that does name a file. This suggests that /../ interpretation is Tcl_Filesystem-specific and ought to be done in each Tcl_Filesystem's Tcl_FSNormalizePathProc rather than in the core FS layer.
- icomment:
The rules of path resolution by linux system calls are spelled out here. http://man7.org/linux/man-pages/man7/path_resolution.7.html According to them, Tcl needs to pass the "/.." substrings of things like /path/to/../foobar to the system calls intact to get them processed properly against the state of the filesystem. Lexical shortening due to "normalization" or for whatever other reasons lurk in the core of Tcl filesystem operations to pass /path/foobar instead are incorrect. That is, they create a system where the meaning of paths in Tcl are demonstrably inconsistent with the meaning of paths on the platform itself. If Tcl really does mean to intentionally be different, that needs a lot more explanation and spelling out. I think it's just a broken implementation.
- login: "dgp"
- mimetype: "text/plain"
- severity changed to: "Minor"