Findfile finds no files [message #29979] |
Tue, 02 April 2002 18:43  |
Pete Riley
Messages: 3 Registered: April 2002
|
Junior Member |
|
|
Hi,
I just came across a weird problem I'm not sure if it's been talked about
before. I'm using IDL 5.5 on linux RH 7.2. I ran some code which calls
findfile() last week and everything worked out fine. Today, it returns no
files, even with
Print,findfile('*')
Yet $ls shows all the files in the current directory.
Has anyone come across this?
Thanks in advance, Pete
|
|
|
|
|
|
|
Re: Findfile finds no files [message #30056 is a reply to message #29979] |
Wed, 03 April 2002 12:05   |
Stein Vidar Hagfors H[1]
Messages: 56 Registered: February 2000
|
Member |
|
|
Pete Riley <uk2@mac.com> writes:
> Hi,
>
> I just came across a weird problem I'm not sure if it's been talked about
> before. I'm using IDL 5.5 on linux RH 7.2. I ran some code which calls
> findfile() last week and everything worked out fine. Today, it returns no
> files, even with
>
> Print,findfile('*')
>
> Yet $ls shows all the files in the current directory.
>
> Has anyone come across this?
I think I came across something similar a loong time ago, on various
unix systems. The problem arises when you have extremely many (long)
file names matching the pattern. The reason is that findfile uses
(used?) the "ls <pattern>" command, resulting in a file-name
expansion that causes an error with too long command lines.
Note: If I'm correct, I think you'll get all of the files by using
findfile with no arguments (i.e. spawning an ls command with no
filename expansion of the command line)!
The only way I've found around it is to write a separate find_file
function that uses e.g. "find -name '<pattern>' -print" on unix systems.
--
------------------------------------------------------------ --------------
Stein Vidar Hagfors Haugan
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO
NASA Goddard Space Flight Center, Email: shaugan@esa.nascom.nasa.gov
Mail Code 682.3, Bld. 26, Room G-1, Tel.: 1-301-286-9028/240-354-6066
Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
------------------------------------------------------------ --------------
|
|
|
Re: Findfile finds no files` (linux NFS bug) [message #30133 is a reply to message #30056] |
Sat, 06 April 2002 11:27   |
Robert Stockwell
Messages: 74 Registered: October 2001
|
Member |
|
|
> Pete Riley <uk2@mac.com> writes:
>
>
>> Hi,
>>
>> I just came across a weird problem I'm not sure if it's been talked about
>> before. I'm using IDL 5.5 on linux RH 7.2. I ran some code which calls
>> findfile() last week and everything worked out fine. Today, it returns no
>> files, even with
>>
>> Print,findfile('*')
>>
>> Yet $ls shows all the files in the current directory.
>>
>> Has anyone come across this?
>>
I have, and had to write a piece of code that first checked
the OS, then if *nix, spawned a system command (ls) and then
where'd and strposed the results to get the filtered list.
I would like to point out another file list bug, that caused
many a grey hair.
Under linux redhat 7.0, the NFS has a bug in that for a directory
containg many files (12000 in my case), the filenames are not reported
correctly. Some files will be missing in the ls commands, and some will
be repeated. There are about 5% errors, i.e. a few hundred of files went
missing in ls commands, and a few hundred were repeated in the
'ls' command result.
By "missing" I mean that the file is really there, and can be opened and read
directly, but any "ls" command will not have the file in the result.
This caused my analysis of a large satellite data set to have many small holes
in it, which were only uncovered after I carefully went through the results.
UGH!
Upgrading linux to 7.2 seems to solve the problem
Cheers,
bob stockwell
|
|
|
Re: Findfile finds no files [message #30150 is a reply to message #30056] |
Fri, 05 April 2002 12:17   |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
Stein Vidar Hagfors Haugan <shaugan@esa.nascom.nasa.gov> writes:
> Pete Riley <uk2@mac.com> writes:
>> Hi,
>>
>> I just came across a weird problem I'm not sure if it's been talked about
>> before. I'm using IDL 5.5 on linux RH 7.2. I ran some code which calls
>> findfile() last week and everything worked out fine. Today, it returns no
>> files, even with
>>
>> Print,findfile('*')
>>
>> Yet $ls shows all the files in the current directory.
>>
>> Has anyone come across this?
> I think I came across something similar a loong time ago, on various
> unix systems. The problem arises when you have extremely many (long)
> file names matching the pattern. The reason is that findfile uses
> (used?) the "ls <pattern>" command, resulting in a file-name
> expansion that causes an error with too long command lines.
> Note: If I'm correct, I think you'll get all of the files by using
> findfile with no arguments (i.e. spawning an ls command with no
> filename expansion of the command line)!
> The only way I've found around it is to write a separate find_file
> function that uses e.g. "find -name '<pattern>' -print" on unix systems.
> --
> ------------------------------------------------------------ --------------
> Stein Vidar Hagfors Haugan
> ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO
> NASA Goddard Space Flight Center, Email: shaugan@esa.nascom.nasa.gov
> Mail Code 682.3, Bld. 26, Room G-1, Tel.: 1-301-286-9028/240-354-6066
> Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
> ------------------------------------------------------------ --------------
Pete:
The behavior you describe is the exact symptom of the problem that Stein Vidar
refers to. You can find Stein Vidar's find_file.pro procedure at
ftp://sohoftp.nascom.nasa.gov/solarsoft/gen/idl/system/
I've gotten into the habit of using that instead of the built-in findfile.
William Thompson
|
|
|
Re: Findfile finds no files [message #30529 is a reply to message #30150] |
Sun, 05 May 2002 11:32  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Dear all,
as I remember correctly findfile is an obsolete routine since idl5.5.
The new routine is file_search.
With this routine a lot of find_file problems are solved.
regards
Reimar
William Thompson wrote:
>
> Stein Vidar Hagfors Haugan <shaugan@esa.nascom.nasa.gov> writes:
>
>> Pete Riley <uk2@mac.com> writes:
>
>>> Hi,
>>>
>>> I just came across a weird problem I'm not sure if it's been talked about
>>> before. I'm using IDL 5.5 on linux RH 7.2. I ran some code which calls
>>> findfile() last week and everything worked out fine. Today, it returns no
>>> files, even with
>>>
>>> Print,findfile('*')
>>>
>>> Yet $ls shows all the files in the current directory.
>>>
>>> Has anyone come across this?
>
>> I think I came across something similar a loong time ago, on various
>> unix systems. The problem arises when you have extremely many (long)
>> file names matching the pattern. The reason is that findfile uses
>> (used?) the "ls <pattern>" command, resulting in a file-name
>> expansion that causes an error with too long command lines.
>
>> Note: If I'm correct, I think you'll get all of the files by using
>> findfile with no arguments (i.e. spawning an ls command with no
>> filename expansion of the command line)!
>
>> The only way I've found around it is to write a separate find_file
>> function that uses e.g. "find -name '<pattern>' -print" on unix systems.
>
>> --
>> ------------------------------------------------------------ --------------
>> Stein Vidar Hagfors Haugan
>> ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO
>
>> NASA Goddard Space Flight Center, Email: shaugan@esa.nascom.nasa.gov
>> Mail Code 682.3, Bld. 26, Room G-1, Tel.: 1-301-286-9028/240-354-6066
>> Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
>> ------------------------------------------------------------ --------------
>
> Pete:
>
> The behavior you describe is the exact symptom of the problem that Stein Vidar
> refers to. You can find Stein Vidar's find_file.pro procedure at
>
> ftp://sohoftp.nascom.nasa.gov/solarsoft/gen/idl/system/
>
> I've gotten into the habit of using that instead of the built-in findfile.
>
> William Thompson
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
============================================================ =======
|
|
|