Re: Rename files using IDL - is it possible? [message #72149 is a reply to message #72010] |
Thu, 05 August 2010 10:46   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Aug 5, 3:18 am, LNpellen <lnpel...@gmail.com> wrote:
> I have a problem that FILE_DELETE do not work properly on files having
> special characters in the filename. The files opens perfectly, but
> when I'm finished analysing I want to delete the files automatically
> with FILE_DELETE. The files that I'm working with are autogenerated
> with (Norwegian) characters in the filenames and I'm pretty sure that
> is the reason why FILE_DELETE generates an error.
>
> Any ideas on how I can force IDL to delete these files?
A trick you can use is to use the /DELETE option for the OPEN
procedure. Then the file is automatically deleted when you close it.
Of course, don't close it until you are done!
This pattern:
OPENR, UNIT, filename, /DELETE, /GET_LUN
FREE_LUN, UNIT
was the cross-platform way people deleted files before FILE_DELETE was
implemented.
Craig
|
|
|