Selur's Little Message Board
[BUG] Deleting temporary files may delete personal files - Printable Version

+- Selur's Little Message Board (https://forum.selur.net)
+-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html)
+--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html)
+--- Thread: [BUG] Deleting temporary files may delete personal files (/thread-2994.html)



Deleting temporary files may delete personal files - potejan - 19.12.2022

First and foremost, I want to make it clear I'm not trying to blame the app. To a large extent, this is my fault. But...

Turns out if you set the temp directory to let's say Desktop, or god forbid, the D drive, and then clear the temp files for a video conversion in Hybrid, well, the entire directory will be recursively deleted. Don't ask why, but I had set the temp directory to my external disk D, and now it is completely erased. Thankfully I have backups, but if I didn't, this would not be very fun. Could you maybe rework this feature to make it safer? Hopefully nobody else does what I did, but even if it happens to one more person, this can have devastating consequences.

Thanks a lot!


RE: So Hybrid deleted my computer... - Selur - 19.12.2022

Hybrid only does clear the temp folder when the user asks it to do so.
Hybrid does create a popup that clearly states that it clears the temp folder.
Quote:---------------------------
Info
---------------------------
clearing content of: G:\Temp
---------------------------
OK
---------------------------
Only after that popup is removed by the user, it will delete stuff.
One could still kill Hybrid through the taskmgr up to that point and nothing happens.
By default, it only clears the properly processed files during job processing. (files of failed jobs, failed previews etc. still linger around, and yes some tools Hybrid uses do create sub folders)

=> I could add a prompt to ask the user whether he really wants to clear the temp folder, but aside from that, I'm not sure how I could make it saver.
I add a yes/no question to the popup,..
Quote:---------------------------
Clear folder check
---------------------------
Do you really want to delete the whole content of 'G:\Temp'?
---------------------------
&Yes &No
---------------------------


Cu Selur

Ps.: the lurid title was not unneeded.
PPs.: There's also the 'Config->Paths->Create sub-folder per job in temp path' which would limit Hybrid to deleting just the subfolder for that job.


RE: So Hybrid deleted my computer... - Dan64 - 19.12.2022

Deleting unwanted files or directories could happen for a lot of reasons. And I think at least one time this happened to every Windows user.

Fortunately if one is able recognize the event immediately there is the possibility to recover all the deleted files.

Here a link to a survey of available tools for Windows: Top 10 Best Data Recovery Software in 2022


RE: Deleting temporary files may delete personal files - potejan - 23.12.2022

Sorry, I never intended the title to be lurid. Updated.

My recommendation would be to mark and recognize Hybrid's own temporary files and delete them only, without any way to delete an arbitrary folder. For example, you could store the temp files in a folder "_HYBRID_TEMP", or prefix folders with "HYBRID_TEMP_...", and only delete these folders which you're sure are Hybrid, not the user's personal files. Of course, this will likely be a major change in the way Hybrid works, so I do not expect it, but I think this is the proper solution. I think allowing Hybrid to delete an arbitrary folder specified by the user will always hold a risk like the one in this post.

Regarding recovery, sadly this barely works if you have a modern SSD with TRIM enabled.

Thanks!


RE: Deleting temporary files may delete personal files - Selur - 23.12.2022

@potejan: Assuming you are on Windows, I send you a link to a dev version I made.

Cu Selur