Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7d6d4fc87ae796a73e9ca52635a67e9ec2d0b284fd75480519b0994b7cde7ab8
Ticket: 961646ffffffffffffffffffffffffffffffffff
[file normalize] changes file reference
User & Date: dgp on 2018-06-28 19:06:41
Changes

  1. assignee changed to: "aku"
  2. closer changed to: "nobody"
  3. 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.
    
  4. 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.
    
  5. login: "dgp"
  6. mimetype: "text/plain"
  7. severity changed to: "Minor"