Artifacts Associated With Ticket 1827008
Ticket change [222545e891] (rid 130696) by mgma on 2007-11-06 17:15:50:
- assignee initialized to: "vincentdarley"
- cmimetype initialized to: "text/plain"
- 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.
- foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "mgma"
- subsystem initialized to: "37. File System"
- title initialized to:
delete and copy fail in linux when path contains ".."
- type initialized to: "Bug"
Ticket change [706e165202] (rid 258495) by serhiy.storchaka on 2026-10-17 09:08:45:
- foundin changed to: "8.6.18, 9.0.5, 9.1.0"
- 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.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"