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 #93460 is a reply to message #93459] Fri, 22 July 2016 02:51 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Friday, July 22, 2016 at 11:05:09 AM UTC+2, Dave wrote:
> Hello everyone,
> 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?
> Thanks in advance.
> Dave

I don't think so.
These commands:

CLOSE, unit1
CLOSE, unit2

are the same as

CLOSE, unit1, unit2

But this command could do much more:

CLOSE, unit1, unit2, /all

In fact it will close *all* open units. And you don't need to specify the units at all. In other words it is equivalent to:

CLOSE, /ALL

Now you should see the problem: If you have other units open, this will close them. So it is only useful if you lost track of open units and you want to close them all... Otherwise you might close units that you don't want to close at all.

I hope this helps.

Cheers,
Helder
[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 14:01:06 PDT 2025

Total time taken to generate the page: 0.00434 seconds