Re: logical units unavailable [message #9003] |
Mon, 26 May 1997 00:00 |
J.D. Smith
Messages: 214 Registered: August 1996
|
Senior Member |
|
|
David Fanning wrote:
>
> [This followup was posted to comp.lang.idl-pvwave and a copy was sent to
> the cited author.]
>
> Danial Williams writes:
>
>> I have a program which spawns some c-code, then reads its output. I
>> use the "spawn" command with /get_lun, as in:
>> IDL> spawn,cmd,unit=lun,/get_lun
>>
>> After I've read the results, I use "free_lun" to free the logical
>> unit:
>>
>> IDL> free_lun,lun
>>
>> I find that when I've run this spawn that I get the error:
>>
>> % SPAWN: All available logical units are currently in use.
>>
>> Which is crazy, since every use of a lun frees it also. What is up
>> with this? Is there any way to release all logical units without
>> exiting IDL and loosing all the work I've done?
>
> I don't know exactly what is going on here, but the use of
> the Get_Lun keyword on a Spawn command is highly irregular.
> I know the Spawn command uses the procedure Get_Lun to get
> a unit (which is why you use Free_Lun to free it), but I've
> never seen it called this way. (I don't have a UNIX machine
> to see if it even works.)
>
> In any case, CLOSE, /ALL will close and free any logical
> units that are still open.
Sounds like a unit leak to me. Check any extensive loops in your code...
it could be you're not freeing the unit in the right place. I also
don't think you need the /Get_lun keyword, since spawn uses this by
default.
And David, as for the utility of this method of invocation, see, for
example, the nasa package routine readfits(), which opens a pipe to an
unzip process so that all fits files can be stored compressed without
much difference in read time. But, as you point out, only useful on
unix machines.
JD
|
|
|