Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting sketch caused Processing to delete my entire Downloads folder #424

Closed
kaylinli opened this issue Feb 26, 2022 · 3 comments
Closed
Labels
Critical A major problem that's critical to fix for the next release if possible

Comments

@kaylinli
Copy link

Description

I downloaded a pde file from a friend and opened the pde file from the Downloads folder. Later, I tried to delete the sketch through the Processing app, and it ended up deleting everything in my Downloads folder, which was a lot of files. These files couldn't be found in the recycling bin either, so they were directly deleted by Processing.

Expected Behavior

I was expecting Processing to only delete my pde files.

Steps to Reproduce

  1. Move a pde file to the Downloads folder
  2. Open pde file using Processing
  3. Delete sketch using drop down menu in Processing

Your Environment

  • Processing version:
  • Operating System and OS version: Windows 10

Possible Causes / Solutions

Not sure, it seems like every time Processing deletes a sketch it deletes all the files in the working directory, but since I opened my pde file in the Downloads folder it made the Downloads folder the working directory and deleted everything in there.

@benfry
Copy link
Owner

benfry commented Mar 1, 2022

Yikes, thanks for letting me know. I'll get a fix in ASAP.

The problem is that the file wasn't in a sketch folder, so it seems to have assumed that the “Downloads” folder was the sketch folder. This is new as of beta 6, where we're trying to decouple the requirement for the sketch folder to be named the same thing as the .pde file.

That's tricky to sort out, but we'll think of something. And at a minimum we should only be moving files to the Trash/Recycle Bin so that if there's a glitch like this, it's recoverable.

@benfry benfry added the Critical A major problem that's critical to fix for the next release if possible label Mar 1, 2022
@benfry
Copy link
Owner

benfry commented Mar 3, 2022

Fixed for beta 7, including:

  • Better detection of what's likely a sketch folder and what is not. For this scenario, the PDE would have seen lots of other files in Downloads, and prompted the user to find out whether they intended “Downloads” to be the sketch folder, of if the selected .pde file should be moved to its own folder.
  • Clarified the delete message to include the name of the folder that's about to be removed (see below).
  • Even if deleting, it will (attempt to) move to the trash instead of deleting the files in an unrecoverable way.
  • If opening a bare .pde file like this, it will reset to the default Mode, because using any other Mode requires a sketch.properties file.

Thanks for the report, and sorry for the trouble.

Screen Shot 2022-03-03 at 7 43 28 AM

@benfry benfry closed this as completed Mar 3, 2022
@github-actions
Copy link

github-actions bot commented Apr 3, 2022

This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Critical A major problem that's critical to fix for the next release if possible
Projects
None yet
Development

No branches or pull requests

2 participants