From: SourceForge.net <no...@so...> - 2003-12-12 14:44:27
|
Bugs item #858937, was opened at 2003-12-12 14:44 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=858937&group_id=10894 Category: 35. Pathname Management Group: current: 8.4.5 Status: Open Resolution: None Priority: 5 Submitted By: Colin McDonald (cjmcdonald) Assigned to: Vince Darley (vincentdarley) Summary: problems with file paths containing tilde character Initial Comment: 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=858937&group_id=10894 |