Post by Frank SlootwegYour backup program should be doing permanent deletes when backups
exceed their retention period.
The backup software just does file deletes, that's it. For normal
storage - i.e. HDD, SDD, etc. - that's all there's to it. For those
devices, there no such thing as a "permanent delete". (Does *Windows*
have a "permanent delete" (normal) system/library call? Yes, *File
Explorer* has a "permanent delete" function, but we're not talking
about FE functionality, we're talking about a (backup) program making
normal system/library calls.)
I know of the one methods the OP mentioned: Shift+Del bypasses the
/move/ to the Recycle Bin hence a permanent delete (although undelete
tools may still recover the file).
In an online search, I found:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.fileio.filesystem.deletefile?view=net-6.0
That's an example in one programming language (VisualBasic). To delete
the file (no Recycle Bin), you'd call DeleteFile(<filespec>). To move
the file to the Recycle Bin, you'd call
DeleteFile(<filespec>,<uioption>,FileIO.RecycleOption.SendToRecycleBin).
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-deletefilea
I saw no argument in the DeleteFileA or DeleteFileW functions to specify
if the Recycle Bin was involved or not. However, these functions may
effect a permament delete. I think the SHFileOperation() is used to
"delete by moving to Recycle Bin".
https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shfileoperationa
When used to delete a file, SHFileOperation permanently deletes the
file unless you set the FOF_ALLOWUNDO flag in the fFlags member of the
SHFILEOPSTRUCT structure pointed to by lpFileOp. Setting that flag
sends the file to the Recycle Bin. If you want to simply delete a file
and guarantee that it is not placed in the Recycle Bin, use
DeleteFile.
In another search hit:
https://stackoverflow.com/questions/12574113/permanently-delete-file-c
That mentions a remove() function in C. However, I'm not sure it
bypasses interception by the OS to deposit the file in the Recycle Bin.
https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/1c3tczd6(v=vs.100)?redirectedfrom=MSDN
That delete the file from the file system. Doesn't seem like the
Recycle Bin would get involved. You're deleting the file from the file
system, not performing a copy to elsewhere. From the StackExchange
article:
_unlink("file.ext"); //delete file without sending to Recycle Bin
Seems ANY program can permanently delete a file, or choose to send it to
the Recycle Bin. Depends on how it is coded.
Post by Frank Slootweg... my backup software (which is Cobian Backup).
I thought Cobian was just a coded frontend GUI to console-mode commands,
like VLC and many other video players are just GUI frontends to ffmpeg.
I can't look at it to tell, plus I don't use it, so I have no impetus to
dig into its code. There are no args to del or erase to toggle between
move to Recycle Bin or permanent delete. Cobian was closed source
starting in 2000, became open source in 2007, and went back to closed
source as of version 9. I don't know what the code in Cobian Backup
does to effect a file delete. The original author of Cobian Backup sold
the code to Sweeney back in 2014, and hasn't heard anything back from
Sweeney. The original Cobian Backup author moved to a new app called
Cobian Reflector also .NET based.
https://docs.microsoft.com/en-us/dotnet/api/system.io.file.delete?view=net-6.0
Recycle Bin isn't mentioned. The more I read code examples, a delete
function is a permanent delete unless some flag or attribute is used to
specify moving to the Recycle Bin. There is no safety net to a typical
delete() or remove() function, like mentioned here:
https://www.tutorialkart.com/c-programming/c-delete-file/