Page 1 of 2
Flag for DeleteFile() and DeleteDirectory() to trully erase
Posted: Tue Oct 28, 2008 1:59 pm
by Psychophanta
Since DeleteFile() and DeleteDirectory() functions do not delete file as it does when in windows is pushed SHIFT key and DELETE key at the same time, i.e. delete the file without move it to the trash; there would be interesting to add a flag for these functions to delete the file skipping the trash.
Posted: Tue Oct 28, 2008 2:03 pm
by Fred
Have you really tried these commands ?
Posted: Tue Oct 28, 2008 3:02 pm
by Psychophanta
Yes.
When i use them there appears a Recycled file in my root partition, and the same behaviour happens if i do it from windows without the use of the SHIFT key.
Using the SHIFT key, the files are really deleted and the Recycled file is not created in my root partition.
Posted: Tue Oct 28, 2008 3:13 pm
by Fred
Well, then you have a problem with your Windows (or have installed a soft to do that), as we use the regular API to delete a file/directory.
Posted: Tue Oct 28, 2008 3:43 pm
by Psychophanta
No software installed.
May be a windows issue.
Just install a clean windows XP SP2 and then configure your trash to not move deleted files to it, but simply flush them.
Then the behaviour is exactly as explained above.
And these PB functions ( DeleteFile() and DeleteDirectory() ) act like above i explain. :roll:
BTW the Recycled file created is a hidden one with the standard windows trash icon.
Posted: Tue Oct 28, 2008 5:33 pm
by Kaeru Gaman
Psychophanta wrote:...configure your trash to not move deleted files to it, but simply flush them.
maybe that's the point...?
that Windows has a standard and a with-shift function,
your configuration exchanges them,
and PB calls the with-shift by default.
Posted: Tue Oct 28, 2008 5:57 pm
by Psychophanta
Nope; what happens is what i said, i.e. PB functions work in a "without SHIFT" way by default.
Posted: Tue Oct 28, 2008 6:07 pm
by freak
Well, whatever it is must be local to your computer.
PB directly calls DeleteFile(), which does not move to the recycle bin. (see
http://msdn.microsoft.com/en-us/library ... S.85).aspx )
> BTW the Recycled file created is a hidden one with the standard windows trash icon.
You probably have the file still open from another program, which causes the file to not be deleted until the file is closed.
(see link above)
Posted: Tue Oct 28, 2008 6:19 pm
by Kaeru Gaman
Psychophanta wrote:Nope; what happens is what i said, i.e. PB functions work in a "without SHIFT" way by default.
you just told it the other way round:
you said that you reconfigured your trashbin to completely delete by default.
that means, moving to trashbin is
with shift on your system, or not?
Posted: Tue Oct 28, 2008 6:37 pm
by Psychophanta
The behaviour is known to happen since i know XP. And it has nothing to be with a file is in use or not, as the file is indeed deleted.
Kaeru Gaman wrote:
you said that you reconfigured your trashbin to completely delete by default.
that means, moving to trashbin is with shift on your system, or not?
No.
I use SHIFT while delete a file/s; just to avoid that damned file to be created in the root partition letter. But PB functions create it; that is why PB functions act like if i delete without-SHIFT key pressed.
I doubt it does not happen to you.
Posted: Tue Oct 28, 2008 7:01 pm
by Kaeru Gaman
ok... so you description above led me wrong...
so you problem is not that the file is not deleted...
your problem is, that an inexisting trashbin on a partition is newly created though it's not used?
... sorry but why in the world don't you write that
but puzzle people by talking about truly erasing/not erasing?

Posted: Tue Oct 28, 2008 7:33 pm
by Psychophanta
Damn. Where i wrote the file was not erased?
The file is normally erased. But there is created a file named Recycled in the letter partition where the erased file hanged from; i.e. if i delete a file located in D:\sdsf\wrer\ then in D:\ appears the Recycled file as hidden and with the standard trash icon.
I guess in some way the "erased" file is contained in that Recycled file/folder created.
Anyway not important, there are other really important things, forget it.
Posted: Tue Oct 28, 2008 8:07 pm
by Kaeru Gaman
Where i wrote the file was not erased?
exactly here:
Flag for DeleteFile() and DeleteDirectory() to trully erase
Posted: Tue Oct 28, 2008 8:21 pm
by Trond
Psychophanta wrote:Damn. Where i wrote the file was not erased?
Since DeleteFile() and DeleteDirectory() functions do not delete file...
Posted: Tue Oct 28, 2008 9:29 pm
by Psychophanta
Trond wrote:Psychophanta wrote:Damn. Where i wrote the file was not erased?
Since DeleteFile() and DeleteDirectory() functions do not delete file...
What about to read the entire thing?
Since DeleteFile() and DeleteDirectory() functions do not delete file as it does when in windows is pushed SHIFT key and DELETE key at the same time
@Kaeru, the matter is that i believed the file went to that Recycled folder (i know it is indeed a system folder because when i delete it the system complains and warns about to delete a .ini system file). That is the reason of the title. So yes, you are right in part, sorry.
