X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 08 Jul 2019 02:30 PM by  Ben Castellani
IDL FREE_LUN error
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

Drew Ciampa



New Member


Posts:
New Member


--
25 Jun 2019 01:37 PM
    I have a script that loops over a function that opens different files and reads their contents. At its root, the function is utilizing FXREAD.PRO to read the FIT file. On about the 200th iteration the script stops with the error...


    % FREE_LUN: Error closing file. Unit: 100, File: /PATH/TO/FILE
    Bad file descriptor

    I'm guessing this means that the LUN assigned for the opened file is not being closed properly? and a open unused LUN is not available?

    Since I was using FXREAD.PRO I figured this error would be avoided since the LUN would be closed/freed inside FXREAD, but I feel I'm not wrong with this assumption.

    Does this make sense?

    Thanks in advance!!

    Ben Castellani



    Basic Member


    Posts:130
    Basic Member


    --
    08 Jul 2019 02:30 PM
    It's hard to say what is happening. FXREAD (a third-party script) does appear to utilize FREE_LUN so it should be managing the file descriptors properly. Depending on what else you code is doing, you might be able to work-around this by using CLOSE with the ALL keyword.

    Is it possible you can provide a sample code snippet that reproduces the behavior? Maybe a loop that uses FXREAD to open a fits file and fails after many iterations?
    You are not authorized to post a reply.