file_search windows problem [message #35091] |
Wed, 14 May 2003 03:49  |
Jacques Basson
Messages: 17 Registered: May 1999
|
Junior Member |
|
|
Hi all
I am having a problem with file_search and windows UNC names.
file_search using the "\\hostname\sharename..." returns 0 files always.
findfile using the exact same path as file_search works fine. If I use a
mapped drive, then file_search returns the correct answer.
IDL> print, file_search("\\machine\share\path\*", count=n)
0
IDL> print, findfile("\\machine\share\path\*", count=n)
5
IDL> print, file_search("G:\path\*", count=n)
5
I need to use \\hostname because the IDL program must run on various
machines therefore I can't use file_search. Also I can't use findfile
because it falls foul of a very obscure windows bug - windows matches
wildcards against both the full name and the 8.3 name. As an example,
for the files below,
C:\tmp>dir /X
Volume in drive C has no label.
Volume Serial Number is 5823-C19A
Directory of C:\tmp
2003/05/14 12:19 <DIR> .
2003/05/14 12:19 <DIR> ..
2003/05/14 12:18 0 123456~1.DAT 123456789A.dat
2003/05/14 12:18 0 123456~2.DAT 123456789B.dat
2003/05/14 12:18 0 123456~3.DAT 123456789C.dat
2003/05/14 12:18 0 123456~4.DAT 123456789D.dat
2003/05/14 12:18 0 1209B9~1.DAT 123456789E.dat
2003/05/14 12:19 0 1219BD~1.DAT 1234567B9E.dat
6 File(s) 0 bytes
2 Dir(s) 34,168,795,648 bytes free
IDL gets 2 matches for the string "*B9*"
IDL> print, findfile('C:\tmp\*B9*')
C:\tmp\123456789E.dat C:\tmp\1234567B9E.dat
In file_search, there are workarounds...
IDL> print, file_search('C:\tmp\*B9*')
C:\tmp\1209B9~1.DAT C:\tmp\1234567B9E.dat
IDL> print, file_search('C:\tmp\*B9*dat', fold_case=0)
C:\tmp\1234567B9E.dat
Does anyone have any suggestion for a workaround?
Cheers,
Jacques
|
|
|