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

Downloads are left around when moving them across drives #1

Open
1 of 2 tasks
fuzzyweapon opened this issue Apr 3, 2023 · 3 comments
Open
1 of 2 tasks

Downloads are left around when moving them across drives #1

fuzzyweapon opened this issue Apr 3, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@fuzzyweapon
Copy link
Owner

fuzzyweapon commented Apr 3, 2023

If the drive is full, this will actually cause the application to enter an infinite loop.

We need to:

  • Make a timeout on the loop
  • Detect if the destination is a different drive to delete successfully copied files
@fuzzyweapon fuzzyweapon added the bug Something isn't working label Apr 3, 2023
@fuzzyweapon fuzzyweapon self-assigned this Apr 3, 2023
fuzzyweapon added a commit that referenced this issue Apr 4, 2023
When a download happens on one drive and the instance is on another (aka
destination), Java's move method actually copies and does not clean
up after itself.  This fix causes it to detect when a file that has been
copied and deletes it.
@fuzzyweapon
Copy link
Owner Author

We don't detect. If a file create event happens and we're going to move it, then we check if the file still exists (and delete it) after trying to move it. If the file was moved, it won't be there to begin with. If the file was copied, then it will be removed.

@fuzzyweapon
Copy link
Owner Author

Test Results

  • Test got through two resourcepacks (with +s in them) and one mod (skylorlib.jar) and then remained in an infinite loop.
  • The files were copied over, as expected.
  • The copied files were not deleted.
  • Many more jars that were not copied over remained in the Downloads directory

@fuzzyweapon
Copy link
Owner Author

So the real issue is with Firefox's implementation. I sloppily added some code to make sure everything got where it is supposed to, but then Firefox leaves around 0KB files in the downloads folder (usually one or two depending on any file events that come in after I've closed the processing loop and finished cleaning up 0KBs).

As it stands, the fix still has stragglers, but I think I should try a short delay between the main action and the cleanup loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant