Skip to content
Tcl Source Code History Of Ticket c8d1585aa9ad5491
Login

History Of Ticket c8d1585aa9ad5491

Artifacts Associated With Ticket c8d1585aa9ad5491

  1. Ticket change [15c28d0612] (rid 133064) by anonymous on 2013-07-26 13:30:03:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      Hi,
      I have such file/directory structure:
      -test (directory)
      -a.tcl (file)
      -b.tcl (file)
      
      Files content:
      
      #b.tcl
      puts "Hello!"
      #
      
      #a.tcl
      set a  test
      set b {$a}
      source "$b/../b.tcl" ;#this one works on Windows, but doesn't on Linux
      source "$b/b.tcl" ;#this one doesn't work on both platforms
      #
      
      I run a.tcl and get behaviour as described above. This is not connected with 'source' command only, I noticed that at least 'file normalize' behaves similarly, I mean evaluating $b into pure value of $a.
      
      Best regards,
      Bogdan
      
    5. foundin initialized to: "8.5.14"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "a604f9ebda557aaac15c81dee385b0d7b1a51416"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "07. Variables"
    15. title initialized to:
      strange variable of variable evaluation in filesystem path (Windows only)
      
    16. type initialized to: "Bug"
  2. Ticket change [c41a709736] (rid 133069) by dgp on 2013-07-26 15:24:25:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2456500.14196328"
    3. closer changed to: "dgp"
    4. icomment:
      This report seriously obfuscates matters, but
      the key issue is a Duplicate of Tcl Bug 969646
      [961646ffff].
      
      The handling of paths $noSuchDir/../foo is not
      platform independent, and is not consistent before
      and after a [file normalize] is applied.
      
      It is not likely this will be fixed.  Avoid /../
      in your paths when you can, especially for script
      you plan to port to multiple platforms.
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Duplicate"
    8. status changed to: "Closed"
  3. Ticket change [c2bcf0e155] (rid 133094) by anonymous on 2013-07-29 09:38:59:

    1. closedate changed to: "2456502.90208094"
    2. closer changed to: "anonymous"
    3. icomment:
      @dgp: With all respect, how is this a duplicate of ticket 961646ffff? There is no problem with finding file. There is problem with treating something syntaxicaly similar to tcl variable inside such path as real tcl variable. Could you give any details which justify such behaviour in this case? 
      Names with $ are not forbidden on Windows, so let's say I have path "c:/$test" and by accident I have variable 'test' too. In case 961646ffff 'file normalize' helps to prepare acceptable path, but in this case there is no way to do this.
      
    4. login: "anonymous"
    5. mimetype: "text/plain"
  4. Ticket change [2d13aefc71] (rid 133095) by jan.nijtmans on 2013-07-29 10:00:29:

    1. closedate changed to: "2456502.91700895"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      > source "$b/../b.tcl" ;#this one works on Windows, but doesn't on Linux
      
      That this  works on Windows is actually a Windows bug, it shouldn't
      work at all!
      
      @bogdan, So, you are making two mistakes: 1) Assume that "set b {$a}" replaces $a with it's content, that's what's making this Bug-report tricky to understand.
      2) Handling of paths containing "/../" in "file normalize". That's a dup of [961646ffff] (actually "file normalize" making the same mistake as path resolving on Windows).
      
      So, I concur with dgp on this. Sorry ;-)
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/plain"
  5. Ticket change [07003b0052] (rid 133099) by anonymous on 2013-07-29 13:00:55:

    1. closedate changed to: "2456503.04231243"
    2. closer changed to: "anonymous"
    3. icomment:
      @jan.nijtmans: No need to sorry, obviously I missed something here.
      
      >> source "$b/../b.tcl" ;#this one works on Windows, but doesn't on Linux
      > That this  works on Windows is actually a Windows bug, it shouldn't work at all!
      
      I suppose that on Windows such path "dir/.." is equal to ".", so "$b/../b.tcl" means "./b.tcl", which is OK in this case.
      
      > So, you are making two mistakes: 1) Assume that "set b {$a}" replaces $a with it's content
      
      I assumed that 'source "$b/../b.tcl"' replaces $b into string '$a', and then, somwhere inside 'source', '$a' into value of variable $a. However, it seems that in case of "dir/.." the 'dir' is just ignored (Windows only? seems like kind of optimization) and such path changed into ".", which makes it working on Windows.
      
      Well, finally I can concur with dgp on this too. Thanks!
      
    4. login: "anonymous"
    5. mimetype: "text/plain"