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

Home » Public Forums » archive » Re: handling zero size file
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: handling zero size file [message #52559] Mon, 12 February 2007 14:27 Go to previous message
Kenneth Bowman is currently offline  Kenneth Bowman
Messages: 86
Registered: November 2006
Member
In article <eqqo6t$7u0$1@news.nems.noaa.gov>,
Spam Bob <spambob@bikinibottom.net> wrote:

> I have an idl program that I call from perl. I send the idl program two
> files (file1 and file2).
>
> PRO mentor_nf, file1, file2, loc
>
> If both files are nonzero size it runs fine plotting both (this is a two
> panel plotting program). If I'm missing some data and either file1 or
> file2 is zero size, the program bombs. I would like it to go ahead and
> plot the nonzero sized file and just leave the other panel blank.
>
> Here is where the program fails:
> DATA1 = READ_ASCII(file1, TEMPLATE=PLOTTEMPLATE)
>
> and this is the error:
> % READ_ASCII: File "/data/file1_20060322.dat" is not a valid ASCII file.
>
> I tried the MISSING_VALUE keyword but that didn't change anything.

Use FILE_INFO to check the file size before opening it.

Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: attn: courtnay - very well designed nntp access - tib oh - (1/1)
Next Topic: quickly totaling sections of an array

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

Current Time: Sun Oct 12 00:49:33 PDT 2025

Total time taken to generate the page: 0.88400 seconds