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
|
|
|
Re: file_search windows problem [message #35257 is a reply to message #35091] |
Thu, 22 May 2003 10:13  |
wgallery
Messages: 32 Registered: December 1998
|
Member |
|
|
Jacques Basson <basson@cyclopsNoSpAmnu.ac.za> wrote in message news:<1052909384.778379@osprey.und.ac.za>...
> 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
I have a related problem. On Windows NT, I have a file
'at_fastlook.pro' plus its Emacs backup 'at_fastlook.pro~' as follows:
(from msdos dir /x)
05/20/03 04:21p 71,956 AT_FAS~1.PRO at_fastlook.pro
05/20/03 04:17p 71,952 AT_FAS~2.PRO at_fastlook.pro~
In idl (5.6), findfile returns:
DL> print, findfile('at_fas*.pro')
at_fastlook.pro at_fastlook.pro~
while file_search returns:
IDL> print, file_search('at_fas*.pro')
AT_FAS~2.PRO at_fastlook.pro
i.e. both the file and the backup file are returned. This appears to
be true for any file with 4 characters in the extension.
Question: how can I get findfile or file_search to return only files
with the '.pro' extension without additional programming?
Cheers,
Bill Gallery
|
|
|