Posted by mouse@xxxx.xxx on 2000-07-13
TC>Date: Wed, 12 Jul 2000 20:30:49 +0200
TC>From: Maarten Albrecht <maarten.a@xxx.xxx>
TC>Subject: Re: Run me and I delete myself . . .
TC>I don't think Windows will let you delete a file that's being used.
TC>Maybe this is the solution:
TC>http://www.delphi3000.com/article.asp?id=561
TC>--Maarten
There are file(s) you can, and can not delete when in use. It's not
entirely at Windows fault as to when you can, or can not. I have
myself have seen and done it myself. Where I could, and then could
not erase file(s) on any given drive.
Someone told me before, you can write a program to unlock the file
or files you wish to erase to access it for various purposes. I do
know that in C, it can be done. C++ is questionable, unless you do
add code to unlock it, likewise with Delphi, Visual Basic, Visual
C++ among many others.
I downloaded Delphi 5 Enterprise the other day, almost a week ago
[Ad finally decided that I do not like it. Mainly because that the
way Delphi is designed, it looks almost like Visual Basic, which I
myself hate! The download IMHO was a complete waste, although I do
now have it placed on CD, so I don't have to download it again if
I should ever need Delphi.
Great, I was going to give a code-snip, and now I forget how I was
going to do it. There was one code (5 strings) or so, to do it. I
in all honesty can not remember it. I'll post it if I remember it.
I guess you can try this type though, which is completely different
>from what I was originally going to post though:
/*
* Replace the "your_program" with the name of your application's
* executable. If your are using Linux or simular OS, replace the
* del to, "rm" unless it's aliased differently, or kept same and
* aliased as well.
*/
#include <stdio.h>
main()
{
system ("del your_program");
return 0;
}
Believe me, the (system) function was not going to be used in this
case. I was going to use something else, but forget completely on
which one it was/is. Sorry, but hope this helps as it is extremely
early in the morning and I've been up for more then 25-28 hours
straight.
Previous post | Next post | Timeline | Home