Skip to content
Tcl Source Code View Ticket
Login

View Ticket

glob with drive relative path fails

Closed / Fixed898238ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2004-02-16 19:41:21
Compare these two glob commands given
on Windows 2000 from the MKS Korn shell

771 C:/p/airvid/img/c2> tclsh84
% glob /p/airvid/img/c2/*gif
/p/airvid/img/c2/12.00.00f.gif /p/airvid/img/c2/12.00.00t.
gif /p/airvid/img/c2/12.00.01f.gif /p/airvid/img/c2/12.00.0
1t.gif /p/airvid/img/c2/12.00.02f.gif /p/airvid/img/c2/12.0
0.02... (more files truncated)
% exit
773 C:/p/airvid/img/c2> tclsh85
% glob /p/airvid/img/c2/*gif
no files matched glob pattern "/p/airvid/img/c2/*gif"

% glob c:/p/airvid/img/c2/*gif
c:/p/airvid/img/c2/12.00.00f.gif 
c:/p/airvid/img/c2/12.00.00t.gif 
c:/p/airvid/img/c2/12.00.01f.gif 
c:/p/airvid/img/c2/12.00.01t.gif 
c:/p/airvid/img/c2/12.00.02f.gif c:/p/airvid/img
/c2/12.00.02t.gif c:/p/airvid/img/c2/12.00.03f.gif 
c:/p/airvid/img/c2/12.00.03t.gif 
c:/p/airvid/img/c2/12.00.04f.gif 
c:/p/airvid/img/c2/12.00.04t.gif 
c:/p/airvid/img/c2/12.00.05f.gif ... (more files truncated)

It seems quite apparent that the windows glob no longer
works right on patterns that begin with slash.

This install was built from snapshot file: 
tcl-20040213.tar.gz

Regards and thanks,
Roy Terry
vincentdarleyplain2004-03-27 02:19:27
Logged In: YES 
user_id=32170

I can reproduce it, so I'll look into fixing it.
vincentdarleyplain2004-03-28 01:50:31
Logged In: YES 
user_id=32170

I have a fix for this, but in the same way that glob
'foo\\bar' gets converted to 'foo/bar' in the list of
results, it will convert your 'glob /p/airvid' to list
results as 'C:/p/airvid ...'.

Is that ok?
royterryplain2004-03-28 01:58:26
Logged In: YES 
user_id=146884

This will work for me in my present usage. 
The fix which adds a drive component doesn't "feel" right to 
me and I wonder if it will create incompatibility bugs upon 
migration from 8.4 to 8.5.  BTW, is this behavior covered in 
the test cases?
vincentdarleyplain2004-03-29 01:09:17
Logged In: YES 
user_id=32170

Unfortunately, volumerelative paths are hardly tested in the
test suite (I assume you would have run the test suite
yourself before reporting this anyway?).

8.4 therefore has a number of problems with such paths --
some stuff works, some doesn't.  In particular, vfs support
for volume relative paths is v. poor in 8.4 (but ok in 8.5).
vincentdarleyplain2004-03-30 22:46:18
Logged In: YES 
user_id=32170

I note that 'glob //Machine/Shared/*' also fails, and I'm
fixing that too.
Log in (anonymous is fine) to add a comment.