windows: Glob returns [file normalize]'d paths
Closed / Out of Date913536ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 14 years ago
Descriptionplain2004-03-10 15:01:24
OS: Windows/Cygwin
% set a [file join / var tmp *]
/var/tmp/*
% set b [glob $a]
{D:/cygwin/var/tmp/errors} D:/cygwin/var/tmp/p.log
From the glob documentation (8.4.5), I expected:
{/var/tmp/errors} /var/tmp/p.log
So, without the windows style such as provided
(as expected) by file normalize.
% file normalize /var/tmp/errors
D:/cygwin/var/tmp/errors
This behaviour brokes a script designed on a Unix
box:
A [lsearch -exact] between a result of a
[split [glob [file join ...]]] and a
[file join ...]
The glob introduces the windows drive but not
the file join.
It may be the normal behaviour. If so, I think
it should be more clear in the doc.
dkf Ticket [913536ffff]: 2 changes
[History diff]2004-03-10 22:44:39
hobbsplain2004-03-11 00:16:24
Logged In: YES user_id=72656 This should be noted in the docs, but it is the correct behavior. It's the oddity of cygwin in the mix that is the difference.
p_samsonplain2004-03-11 19:29:41
Logged In: YES user_id=994002 So be it. As a workaround, I added a [file normalize] to the [file join] for the [lsearch] to compare things of the same style.
vincentdarleyplain2004-03-22 19:33:14
Logged In: YES user_id=32170 I don't really use or know cygwin, and can't really comment on this. For ordinary Win-Tcl it all works fine.
nijtmansplain2012-08-03 14:16:20
allow_comments - 1 Since the Cygwin port is now derived from the UNIX port, This issue can be considered out of date: Drive prefixes, as on Windows, are not used any more So, closing
Log in (anonymous is fine) to add a comment.