Re: file command bug on windows



Mark Janssen <mpc.janssen@xxxxxxxxx> writes:

The fact that ~something is interpreted as a home directory is working
as documented and is useful in windows as well as in Unix.

The manual page for `filename` on Tcl 8.4.13 says this:

<- begin quote ->
The Macintosh and Windows platforms do not support tilde substitution
when a user name follows the tilde. On these platforms, attempts to use
a tilde followed by a user name will generate an error that the user
does not exist when Tcl attempts to interpret that part of the path or
otherwise access the file. The behaviour of these paths when not trying
to interpret them is the same as on Unix. File names that have a tilde
without a user name will be correctly substituted using the $HOME
environment variable, just like for Unix.
<- end quote ->

However, on Windows 2000:

(bin) 12 % file normalize ~hello
user "hello" doesn't exist
(bin) 13 % file normalize ~Administrator
D:/

So the documentation seems wrong for this specific part of tilde
expansion.

(and it is a real pleasure to discover that an user can make your app to
err just choosing a filename that is perfectly okay on his platform) :-/

--
Oscar
.



Relevant Pages

  • Re: Tilde expansion on (Windows)files?
    ... Tcl 8.5.4, Windows XP - test: ... What does this mean, which filename is searched? ... If it works on Windows, why doesn't it find the file? ... 'file normalize' interaction with tilde ...
    (comp.lang.tcl)
  • Re: C++ Server & Tcl client
    ... Write an alternate simple server in Tcl which will eventually be ... test the server by using telnet systemname portnumber ... You can do exactly this on Windows too. ... for Unix will work on Windows with no changes. ...
    (comp.lang.tcl)
  • Re: file command bug on windows
    ... leading tilde is just another symbol on Windows, ... If tcl treats it on a specific way, ... "./~foo" is a ligit filename and is a filename that starts with the ...
    (comp.lang.tcl)
  • Re: C++ Server & Tcl client
    ... Write an alternate simple server in Tcl which will eventually be ... test the server by using telnet systemname portnumber ... You can do exactly this on Windows too. ... for Unix will work on Windows with no changes. ...
    (comp.lang.tcl)
  • Re: file command bug on windows
    ... I agree that every user has a valid home directory. ... Windows the user's home ... directories are not referred to with a leading tilde symbol. ... You should realize that tilde is also 'just another symbol' on UNIX as ...
    (comp.lang.tcl)