Menu

#2617 windows: Glob returns [file normalize]'d paths

obsolete: 8.4.1
closed-out-of-date
5
2012-08-03
2004-03-10
No

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.

Discussion

  • Donal K. Fellows

    • labels: 105657 --> 36. Pathname Management
    • assigned_to: dkf --> vincentdarley
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2004-03-10

    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.

     
  • Patrick Samson

    Patrick Samson - 2004-03-11

    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.

     
  • Vince Darley

    Vince Darley - 2004-03-22
    • assigned_to: vincentdarley --> stwo
     
  • Vince Darley

    Vince Darley - 2004-03-22

    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.

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-08-03

    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

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-08-03
    • status: open --> closed-out-of-date