comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Curious FindFile behavior
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Curious FindFile behavior [message #13767 is a reply to message #13589] Fri, 27 November 1998 00:00 Go to previous messageGo to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Barry Lesht wrote:

> I'm running IDL5.1 on an SGI (IRIX6.2). I'm using FindFile to create
> an array of data filenames that I can pass to some processing code.
> There are (as it turns out) 515 files in the directory I'm searching.
> The filenames are all of the form xxxxxxxxx.xx.yymmdd.hhmmss.cdf. I
> get the following from FindFile-
>
> IDL> files=FindFile('*.*', COUNT=nf)
> IDL> PRINT, nf
> 0
> [...]
>
> I don't see why cases 2 and (especially) 3 didn't result in nf=515.
> Can anyone explain this? Thanks.
>
> Barry Lesht
> bmlesht@anl.gov

Yup,

this seems to be an SGI related problem. I have never heard of other
machines with this behaviour. I had once contacted RSI about a similar
problem, and they replied it may have to do with the shell expansion (in
my case I was getting into trouble using '~' identifiers even in small
directories). It would probbaly help if you could forward this bug
report to RSI -- maybe they will fix it at some point...

Please find below a third variant of a routine that has been designed to
overcome the problem you posted,

Regards,
Martin.

--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Engineering&Applied Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------



; $Id: mfindfile.pro,v 1.1 1998/10/09 19:53:32 mgs Exp $
;----------------------------------------------------------- --
;+
; NAME:
; MFINDFILE
;
; PURPOSE:
; find all the files that match a given specification.
; On our system, the IDL findfile function does not
; work correctly!!
;
; CATEGORY:
; System routines
;
; CALLING SEQUENCE:
; listing = MFINDFILE(filemask)
;
; INPUTS:
; FILEMASK -> a path and filename specification to look
; for.
;
; KEYWORD PARAMETERS:
; none
;
; OUTPUTS:
; A string list containing all the files that match the
; specification.
;
; SUBROUTINES:
;
; REQUIREMENTS:
;
; NOTES:
; Spawns a unix ls -1 command !
;
; EXAMPLE:
; list = mfindfile('~mgs/terra/chem1d/code/*.f')
;
; ; returns all fortran files in Martin's chem1d directory.
;
; MODIFICATION HISTORY:
; mgs, 14 Sep 1998: VERSION 1.00
;
;-
; Copyright (C) 1998, Martin Schultz, Harvard University
; This software is provided as is without any warranty
; whatsoever. It may be freely used, copied or distributed
; for non-commercial purposes. This copyright notice must be
; kept with any copy of this software. If this software shall
; be used commercially or sold as part of a larger package,
; please contact the author to arrange payment.
; Bugs and comments should be directed to mgs@io.harvard.edu
; with subject "IDL routine mfindfile"
;----------------------------------------------------------- --


function mfindfile,mask



if (!version.os_family eq 'unix') then begin
; make my own findfile

path = extract_path(mask,filename=fname)
path = expand_path(path)
newpath = path+fname

; print,'fname:',fname,' path:',path,' newpath:',newpath

command = 'ls -1'
cstr = command+' '+newpath
spawn,cstr,listing

return,listing

endif else begin ; other OS - use IDL's original

return,findfile(mask)

endelse

end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: vector plots and map backgrounds
Next Topic: Masking of land/sea

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 10:25:36 PDT 2025

Total time taken to generate the page: 1.19709 seconds