comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL doesn't close files.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL doesn't close files. [message #38989 is a reply to message #38987] Thu, 15 April 2004 14:57 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
wl wrote:
> I create a text file in IDL using openw, write some text to it, then
> close it using
> close, u, /force
> free_lun, u, /force
>
> Then, when I try to open it in a text editor (I use the FAR manager's
> internal editor) it says that is unable to open it because of sharing
> violation.
>
> What should I do to close just created file without exiting IDL?

It *should* work.

It's not normally necessary to use /FORCE. What happens when you omit it?

Also, it's not normally necessary to use CLOSE. FREE_LUN on its own
should close the file if necessary, before freeing the unit number. (But
using CLOSE shouldn't cause a problem.)

Have you made some more elementary mistake, like passing an incorrect
unit number? For example, the following would leave file1 opened:

openw, u, file1, /GET_LUN
openw, u, file2, /GET_LUN
...write some stuff
free_lun, u
free_lun, u

What happens when you try CLOSE, /ALL?


--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Transparent polygons
Next Topic: need to develop interactive plot routine

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 20:23:37 PDT 2025

Total time taken to generate the page: 1.35989 seconds