Re: check for already written and finished files [message #56554 is a reply to message #56537] |
Mon, 29 October 2007 10:01  |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
you are looking for semaphore files. check sem_create etc. Haje
<mdoubkova@gmail.com> wrote in message
news:1193672982.184164.52510@22g2000hsm.googlegroups.com...
> Hello all,
>
> I am dealing with an annoying problem which I hope may find a solution
> somewhere within the IDL audience.
>
> I call ENVI module from IDL which geocodes a binary file and saves it
> under new name also as a binary. Then, I want to proceed with
> processing of this newly created file. First I check for its existence
> and if its readable. Then I start reading this file using READ_BINARY.
>
> The problem is that this file is assigned as readable by file_test(..,/
> read) but is not yet fully geocoded (its obvious when looking at the
> file in windows commander and pressing F5, its size is increasing with
> every click) and thus I cannot be read by READ_BINARY. I want to force
> IDL to wait until the file is fully written. However I did not find a
> way how to do this. Sofar I am just using command wait, however, my
> files have varying size and sometimes its not necessary to wait at
> all, sometimes it takes 1 minut to write the file.
>
>
> Here is the example of the code
>
> ""
> sarscape_geocode, extractedGM, geocodedGM , tmp_control ;calls
> sarscape ENVI modul
> ;?? wait,30??
> test_geocodedFile=file_test(geocodedGM,/read)
> if test_geocodedFile eq 1 then check='OK' else check='ERROR'
> print, logunit, string(' Geocoding ', check, ' ',systime())
> printf, logunit, string(' Geocoding ', check, ' ',systime())
>
> if check eq 'OK' then begin
>
>
> I am gratefully for any answer,
>
> greetings
> Marcela
>
|
|
|