Re: Free_lun ALL [message #40451] |
Wed, 11 August 2004 09:21 |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
David Fanning wrote:
> Paul Van Delst writes:
>
>
>> Rafael Loos wrote:
>>
>>> Hi,
>>> Is there a way to free all the units that you have created?
>>> Or I need to specify all the Unit names?
>>>
>>> I mean something like that:
>>>
>>> Free_lun, /all
>>>
>>> Or I need to do:
>>>
>>> Free_lun, unit1
>>> Free_lun, unit2
>>> Free_lun, unit3
>>
>> CLOSE, /ALL
>>
>> should do what you want (I think). It closes ALL open files and free's their luns too.
>>
>> paulv
>
>
> Ooogh, I'd be careful telling someone who is just
> becoming familiar with IDL (and the on-line help
> system) to do something like this. This is one of
> those Bad Programming Practices that sooner or later
> leads to HEAP_GC showing up in their code. :-(
True, but I assumed the OP needed to close ALL open files because an error occurred, or
you've inserted a STOP statement in your code. Then, when you get tossed back out to the
IDL prompt you do something like:
IDL> close, /all
IDL> retall
although I now prefer the more bull-in-a-china-shop method,
IDL> .reset_session
:o)
So, to the OP, I personally *never* use CLOSE,/ALL in "real" IDL code. Just in the debug
parts.
paulv
p.s. Although I hear that HEAP_GC is a favourite of some.... :o)
|
|
|
Re: Free_lun ALL [message #40452 is a reply to message #40451] |
Wed, 11 August 2004 09:04  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul Van Delst writes:
> Rafael Loos wrote:
>> Hi,
>> Is there a way to free all the units that you have created?
>> Or I need to specify all the Unit names?
>>
>> I mean something like that:
>>
>> Free_lun, /all
>>
>> Or I need to do:
>>
>> Free_lun, unit1
>> Free_lun, unit2
>> Free_lun, unit3
>
> CLOSE, /ALL
>
> should do what you want (I think). It closes ALL open files and free's their luns too.
>
> paulv
Ooogh, I'd be careful telling someone who is just
becoming familiar with IDL (and the on-line help
system) to do something like this. This is one of
those Bad Programming Practices that sooner or later
leads to HEAP_GC showing up in their code. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Free_lun ALL [message #40453 is a reply to message #40452] |
Wed, 11 August 2004 08:50  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Rafael Loos wrote:
> Hi,
> Is there a way to free all the units that you have created?
> Or I need to specify all the Unit names?
>
> I mean something like that:
>
> Free_lun, /all
>
> Or I need to do:
>
> Free_lun, unit1
> Free_lun, unit2
> Free_lun, unit3
CLOSE, /ALL
should do what you want (I think). It closes ALL open files and free's their luns too.
paulv
|
|
|
Re: Free_lun ALL [message #40454 is a reply to message #40453] |
Wed, 11 August 2004 08:22  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Rafael Loos writes:
> Is there a way to free all the units that you have created?
> Or I need to specify all the Unit names?
>
> I mean something like that:
>
> Free_lun, /all
>
> Or I need to do:
>
> Free_lun, unit1
> Free_lun, unit2
> Free_lun, unit3
Well, I tried this:
IDL> ? Free_Lun
And I learned that this is available:
Free_Lun, unit1, unit2, unit3
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|