Skip to content
Tcl Source Code History Of Ticket 1827008
Login

History Of Ticket 1827008

Artifacts Associated With Ticket 1827008

  1. Ticket change [222545e891] (rid 130696) by mgma on 2007-11-06 17:15:50:

    1. assignee initialized to: "vincentdarley"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The code below runs correctly in Windows, but not in Linux. (I'm using ActiveTcl 8.4.7 in both cases).
      
      % file mkdir d1/d2/d3
      % file delete -force d1/d2/d3/..
      
      In Windows, it deletes d2 and leaves d1 empty. However, in Linux I get the error:
      
      'error deleting "d1/d2/d3/..": no such file or directory
      
      In Linux, d3 is deleted, but not d2.
      
      In order that it works I must normalize the file name:
      
      % file delete -force [file normalize d1/d2/d3/..]
      
      I think that it might not be correct that the operation is partially performed and then fails. I also find the error message not very descriptive of the problem.
      
      The same thing happens when using [file copy] with directory paths containing "..".
      
      I've asked about this at comp.lang.tcl, and Donald G Porter suggested that it may be the same as Bug 961646.
      
      
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "mgma"
    10. subsystem initialized to: "37. File System"
    11. title initialized to:
      delete and copy fail in linux when path contains ".."
      
    12. type initialized to: "Bug"
  2. Ticket change [706e165202] (rid 258495) by serhiy.storchaka on 2026-10-17 09:08:45:

    1. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
    2. icomment:
      Still there, and since 8.5 the failure is silent: <nowiki>[file delete -force d1/d2/d3/..]</nowiki> deletes the contents of d2 but not d2 itself, and returns success (the final rmdir() fails with ENOENT, which is ignored).
      Proposed fix in branch [/timeline?r=delete-refuse-dot-dot|delete-refuse-dot-dot]: on Unix, refuse to remove a path ending in "." or "..", as rm(1) does. Normalizing the path, as on Windows, would be wrong on POSIX: ".." is resolved physically there, so if d3 is a symbolic link, "d1/d2/d3/.." is the parent of its target, not "d1/d2". Test fCmd-5.14.
      
    3. login: "serhiy.storchaka"
    4. mimetype: "text/x-fossil-wiki"