Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
[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. Cheers, David ---------------------------------------------------------- David Fanning, Ph.D. Fanning Software Consulting Customizable IDL Programming Courses Phone: 970-221-0438 E-Mail: davidf@dfanning.com Coyote's Guide to IDL Programming: http://www.dfanning.com
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? Thanks, Daniel Williams -- +----------------------------------------------------------- ------------------+ |Daniel L. Williams | Email: williams@srl.caltech.edu | |Space Radiation Lab| Telly: 818/395-6634 | |Caltech 220-47 | Fax: 818/449-8676 | |Pasadena, Ca 91125 | WWW: http://www.srl.caltech.edu/personnel/williams.html | +----------------------------------------------------------- ------------------+