[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: filename check



Stuart Colley wrote:
> 
> Can anyone suggest a way to check that a file exists before attempting to
> read from it, since the error messages obtained from trying to read from a
> non-existing file, don't make it clear that file doesn't exist.
> 
> cheers,
> S

No, but the error message you get when you try to open the file with
OPENR will tell you this. You may want to try out my open_file
procedure which adds a couple of additional features such as seemless
integration of the dialog_pickfile routine if you specify a name with
wildcards (or no name at all). And this does error checking...

You can find open_file.pro at
http://www.mpimet.mpg.de/~schultz.martin/idl/html/libmartin_schultz.html

Cheers,
Martin

-- 
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
[[ Dr. Martin Schultz   Max-Planck-Institut fuer Meteorologie    [[
[[                      Bundesstr. 55, 20146 Hamburg             [[
[[                      phone: +49 40 41173-308                  [[
[[                      fax:   +49 40 41173-298                  [[
[[ martin.schultz@dkrz.de                                        [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[