Re: Tilde expansion on (Windows)files?
- From: JMN <neuronstorm@xxxxxxxxx>
- Date: Fri, 7 Aug 2009 01:46:08 -0700 (PDT)
On Aug 2, 12:37 pm, Gerhard Reithofer <gerhard.reitho...@tech-
edv.co.at> wrote:
Hi,
working on a storage optimization system (millions of files) I realized,
that a tilde in a filename makes problems:
Tcl 8.5.4, Windows XP - test:
(gerhardr) 4 % set fl [glob y:/WinXP/*]
{y:/WinXP/~$obkonzept_tech.doc} y:/WinXP/E1007029.exe y:/WinXP/ricohmemory_xp
(gerhardr) 5 % foreach f $fl {puts [file type $f]}
could not read "y:/WinXP/~$obkonzept_tech.doc": no such file or directory
What does this mean, which filename is searched?
If it works on Windows (see man page), why doesn't it find the file?
Another problem is, that the file system is served by a unix server
(Samba or NetApp with Unix security) and the file name on which the
program should run, is:
"/net/pub/WinXP/~$obkonzept_tech.doc"
It doesn't work either.
How can this file be handled in Tcl?
Does anyone know a solution for this problem?
--
Gerhard Reithofer
Tech-EDV Support Forum -http://support.tech-edv.co.at
Adding a 'file normalize' seems to fix it:
foreach f $fl {set f [file normalize $f];puts [file type $f]}
I've reported this previously as bug id: 2806250 - glob, 'file
exists', 'file normalize' interaction with tilde
This is probably more or less the same as bug 2511011 already
mentioned.
I also made some detailed comments about this whole situation in this
newsgroup recently:
http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/54f4cd8c47eaa406/b3602d39c21d7d81?lnk=gst&q=fiasco#
I was hoping my suggestions in that thread may have got a bit more
response from others - in particular Tcl Core team members. Perhaps
my title of ''file join' behaviour and ye olde tilde fiasco' was too
inflammatory - but frankly.. I still think this area is a mess.
Julian
.
- Follow-Ups:
- Re: Tilde expansion on (Windows)files?
- From: Gerhard Reithofer
- Re: Tilde expansion on (Windows)files?
- References:
- Tilde expansion on (Windows)files?
- From: Gerhard Reithofer
- Tilde expansion on (Windows)files?
- Prev by Date: Re: ANN: SQLiteStudio 1.1.3 released!
- Next by Date: Re: ANN: SQLiteStudio 1.1.3 released!
- Previous by thread: Re: Tilde expansion on (Windows)files?
- Next by thread: Re: Tilde expansion on (Windows)files?
- Index(es):
Relevant Pages
|