: MIDRANGE dot COM Mailing List Archive

Re: IFS file stays locked after close


AddThis Feed Button


Hi Rick,

Is it possible that you opened the file twice, but only closed it once?

Or perhaps you ran the program the first time, and the program crashed, leaving the file open? The second run opened the file a second time, and then closed it successfully, but the original run still has the file open?

OR some similar idea? (Like an IF statement that ends the routine prematurely because of some condition -- but forgets to close the file.)

Basically, there are a million variations on this... but they come down to the same thing. Every successful call to open() must be followed by a corresponding successful call to close(). If for any reason one of those closes is missing -- even if subsequent ones are closed successfully -- the file will remain open and locked.


Rick.Chevalier@xxxxxxxxxxxxxxx wrote:
I have a situation in an interactive program where the file appears to be locked even though the program has ended. To free the file I have to sign off. I verified that the close operation is performed and the return code = 0 so I think it should be closed. Searching the archives, Google, and Info Center didn't turn up anything useful. I did try adding the fsync function call in case it was an issue with the buffer not being flushed.

Does anyone have any ideas?

Rick Chevalier




Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2007 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact

.