Overview
| Artifact ID: | 9b7cee1311412c253a086ca9160c2103dda39bc2 |
|---|---|
| Ticket: | 858937ffffffffffffffffffffffffffffffffff
problems with file paths containing tilde character |
| User & Date: | cjmcdonald on 2003-12-12 14:44:27 |
Changes
- assignee changed to: "vincentdarley"
- cmimetype changed to: "text/plain"
- comment changed to:
There are some problems with the processing of file paths containing a ~ tilde character. Tcl 8.4.5 - Unix (Solaris) and Windows (NT4). ------------------------------------------- 1) "file normalize" crashes if an invalid user name is specified: $ tclsh % file normalize ~baduser/readme.txt Segmentation fault (core dumped) ------------------------------------------- 2) For file names which actually start with a tilde the "glob -tails" processing is inconsistent with "file tail": If I have a file /home/mcdonald/temp/~test.dat, then "file tail" produces "./~test.dat", which subsequently can be used correctly with "file join" in order to reconstruct a full file path: $ tclsh % set fname [file tail /home/mcdonald/temp/~test.dat] ./~test.dat % set fspec [file join /home/mcdonald/temp $fname] /home/mcdonald/temp/~test.dat But "glob -tails" returns a file list including "~test.dat", which is assumed to be an absolute file specification by "file join": $ tclsh % set dir /home/mcdonald/temp /home/mcdonald/temp % set fnames [glob -tails -directory $dir *.dat] ~test.dat xyzzy.dat % set fspec [file join $dir [lindex $fnames 0]] ~test.dat So the output from "glob -tails" cannot subsequently be used reliably to reconstruct full file paths with "file join". I think that for files starting with a tilde character "glob -tails" should return ./~test.dat, the same as "file join". ------------------------------------------- 3) The filename.n manpage states in the "Tilde Substitution" section that "The Macintosh and Windows platforms do not support tilde substitution when a user name follows the tilde." That has not been the case on Windows for several releases e.g. ~mcdonald/readme.txt works on Windows.
- foundin changed to: "obsolete: 8.4.5"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "cjmcdonald"
- subsystem changed to: "36. Pathname Management"
- title changed to:
problems with file paths containing tilde character
- type changed to: "Bug"