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

Home » Public Forums » archive » File units (de)allocation in IDL - what is the proper way?
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: File units (de)allocation in IDL - what is the proper way? [message #93462 is a reply to message #93459] Fri, 22 July 2016 03:43 Go to previous message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 07/22/2016 11:05 AM, Dave wrote:
> when opening files to write outputs I usually do:
>
> OPENW, unit1, 'file1.txt', /GET_LUN
> OPENW, unit2, 'file2.txt', /GET_LUN
> ...
> CLOSE, unit1
> CLOSE, unit2
>
> FREE_LUN, unit1
> FREE_LUN, unit2
>
> However, it seems that closing *and freeing* can be equally achieved with:
>
> CLOSE, unit1, unit2, /ALL
>
> Is this correct? Is there a best practice?

not correct, CLOSEing a unit doesn't free it's lun, meaning the file is
closed but the lun number is blocked and cannot be allocated for opening
another process.
However, FREE_LUN implies closing a file if it is not already closed.

For the rest, Herders remarks apply - except that FREE_LUN doesn't have
an /ALL keyword.

So, FREE_LUN, unit1, unit2 would be correct, using separate lines is
only necessary if you need to retrieve the EXIT_STATUS.


Markus Schmassmann

https://www.harrisgeospatial.com/docs/understanding__luns_.h tml
https://www.harrisgeospatial.com/docs/FREE_LUN.html
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Read an ASCII file in a table based on delimeter line string
Next Topic: very very strange thing is happening with modfits......

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

Current Time: Wed Oct 08 17:30:44 PDT 2025

Total time taken to generate the page: 0.00382 seconds