Re: File Delete -- Friggin A!! [message #69570] |
Sun, 07 February 2010 07:28  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
munka writes:
> just add spawn,'rm *' and all the files will be deleted! Even the
> ones you don't want deleted! problem solved!
Yeah, I don't think so. It's more complicated than that. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: File Delete -- Friggin A!! [message #69571 is a reply to message #69570] |
Sun, 07 February 2010 00:59   |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Feb 7, 6:20 am, munka <mynameismu...@gmail.com> wrote:
> On Feb 5, 3:50 pm, David Fanning <n...@dfanning.com> wrote:
>
>> Kenneth P. Bowman writes:
>>> Is that a long way of saying "operator error"?
>
>> Well, not exactly. It's a little more complicated
>> than that. :-)
>
>> Cheers,
>
>> David
>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thue. ("Perhaps thos speakest truth.")
>
> just add spawn,'rm *' and all the files will be deleted! Even the
> ones you don't want deleted! problem solved!
Not necessarily. If the files are open, the OS may put a lock on them,
to keep them from being written or erased by other applications, until
IDL releases the lock by closing the files. Also, unless Windows has
at some point started accepting rm in the command prompt, that would
not work, as in DOS the command was del. Further, the remove command
might ask for confirmation, which would not be provided spawn.
|
|
|
|
|
Re: File Delete -- Friggin A!! [message #69585 is a reply to message #69582] |
Fri, 05 February 2010 12:39   |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article <MPG.25d6108d6d570489896f6@news.giganews.com>,
David Fanning <news@dfanning.com> wrote:
> David Fanning writes:
>
>> Something really weird is happening. I can create files
>> in IDL, and then delete them. The files I am having
>> problems with are opened in objects. In general, these
>> files are closed and then deleted (if required) in their
>> CLEANUP methods. It is as if, when I get into the CLEANUP
>> method, I can no longer access the LUN attached to the
>> file, so these files cannot be closed properly. Once
>> this happens, nothing I can do at the IDL command line
>> can get the files out of this condition, and I have to
>> exit IDL to gain access to permission to delete the files.
>
> OK, all is right with the world again! :-)
>
> My problems were occurring during program development
> efforts while I was testing code and searching for bugs.
> This might explain why tempers were a little frayed this
> morning. In any case, I learned something that has bugged
> me for a while in object programming.
>
> I often find myself in "weird states" when I am debugging
> object programs, and particularly widget object programs.
> Typically when I am debugging, I am setting a lot of
> breakpoints. As a result, my object programs don't always
> run to completion. This can cause problems, of course,
> if you don't destroy the object before you run the next
> iteration of the program. (And who does!)
>
> My problem, quite simply, is that my objects were not
> running to completion and they were not getting destroyed.
> Thus, they were keeping their files open and not allowing
> me to delete them. Being objects, I suppose their innards
> are hidden even from IDL. Or maybe it was because these were
> netCDF files and those file LUNS are not normally accessible
> to IDL's file tools. I don't know. In any case, a judicious
> use of HEAP_GC in addition to CLOSE, /ALL makes it possible
> for me to delete the offending files.
>
> Cheers,
>
> David
Is that a long way of saying "operator error"?
Ken Bowman
|
|
|
Re: File Delete -- Friggin A!! [message #69593 is a reply to message #69585] |
Fri, 05 February 2010 10:25   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> Something really weird is happening. I can create files
> in IDL, and then delete them. The files I am having
> problems with are opened in objects. In general, these
> files are closed and then deleted (if required) in their
> CLEANUP methods. It is as if, when I get into the CLEANUP
> method, I can no longer access the LUN attached to the
> file, so these files cannot be closed properly. Once
> this happens, nothing I can do at the IDL command line
> can get the files out of this condition, and I have to
> exit IDL to gain access to permission to delete the files.
OK, all is right with the world again! :-)
My problems were occurring during program development
efforts while I was testing code and searching for bugs.
This might explain why tempers were a little frayed this
morning. In any case, I learned something that has bugged
me for a while in object programming.
I often find myself in "weird states" when I am debugging
object programs, and particularly widget object programs.
Typically when I am debugging, I am setting a lot of
breakpoints. As a result, my object programs don't always
run to completion. This can cause problems, of course,
if you don't destroy the object before you run the next
iteration of the program. (And who does!)
My problem, quite simply, is that my objects were not
running to completion and they were not getting destroyed.
Thus, they were keeping their files open and not allowing
me to delete them. Being objects, I suppose their innards
are hidden even from IDL. Or maybe it was because these were
netCDF files and those file LUNS are not normally accessible
to IDL's file tools. I don't know. In any case, a judicious
use of HEAP_GC in addition to CLOSE, /ALL makes it possible
for me to delete the offending files.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: File Delete -- Friggin A!! [message #69603 is a reply to message #69593] |
Fri, 05 February 2010 08:20   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Wox writes:
> Not even when .RESET_SESSION or .FULL_RESET_SESSION ?
No.
Something really weird is happening. I can create files
in IDL, and then delete them. The files I am having
problems with are opened in objects. In general, these
files are closed and then deleted (if required) in their
CLEANUP methods. It is as if, when I get into the CLEANUP
method, I can no longer access the LUN attached to the
file, so these files cannot be closed properly. Once
this happens, nothing I can do at the IDL command line
can get the files out of this condition, and I have to
exit IDL to gain access to permission to delete the files.
I'm working on it!
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
|
Re: File Delete -- Friggin A!! [message #69727 is a reply to message #69571] |
Tue, 09 February 2010 14:16  |
munka
Messages: 36 Registered: December 2009
|
Member |
|
|
On Feb 7, 2:59 am, pp <pp.pente...@gmail.com> wrote:
> On Feb 7, 6:20 am,munka<mynameismu...@gmail.com> wrote:
>
>
>
>
>
>> On Feb 5, 3:50 pm, David Fanning <n...@dfanning.com> wrote:
>
>>> Kenneth P. Bowman writes:
>>>> Is that a long way of saying "operator error"?
>
>>> Well, not exactly. It's a little more complicated
>>> than that. :-)
>
>>> Cheers,
>
>>> David
>
>>> --
>>> David Fanning, Ph.D.
>>> Fanning Software Consulting, Inc.
>>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>>> Sepore ma de ni thue. ("Perhaps thos speakest truth.")
>
>> just add spawn,'rm *' and all the files will be deleted! Even the
>> ones you don't want deleted! problem solved!
>
> Not necessarily. If the files are open, the OS may put a lock on them,
> to keep them from being written or erased by other applications, until
> IDL releases the lock by closing the files. Also, unless Windows has
> at some point started accepting rm in the command prompt, that would
> not work, as in DOS the command was del. Further, the remove command
> might ask for confirmation, which would not be provided spawn.
Oh! Well I'm used to working on mac, which allows that particular unix
command
|
|
|