I don't hink addfiles allows what you want directly.
The following may work for you.
http://www.ncl.ucar.edu/Document/Functions/Built-in/ind.shtml
http://www.ncl.ucar.edu/Document/Functions/Built-in/isfilepresent.shtml
files = (/ "qwerty", "abcdef" /)
ii = ind( isfilepresent( files ) ) ; indices of True
print(files(ii))
if (.not.ismissing(ii(0))) then
f = addfiles( files(ii), "r")
:
else
print("All files missing")
exit
end if
Carl J. Schreck, III wrote:
> When using addfiles, is there a way to check if any of the files do
> not exist? The following prints "True" for addfile:
>
> garbageFile = addfile( "qwerty", "r" )
> print( any( ismissing( garbageFile ) ) )
>
> but a similar version for addfiles prints "False":
>
>
> print( any( ismissing( garbageFiles ) ) )
>
> Any suggestions?
>
> Thanks,
> Carl
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 11 2009 - 09:29:34 MDT
This archive was generated by hypermail 2.2.0 : Thu Aug 13 2009 - 14:45:53 MDT