-
Notifications
You must be signed in to change notification settings - Fork 67
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
Infinite Recursive Folder Copy #13
Comments
That would increase wear on the sdcard sadly. It would have to be done on a case by case process. Check weather your copying a file into its subdir each time you copy a file and complain to the user if they are trying to copy a file onto itself. |
The ignore itself thing might still be viable I'd imagine, I haven't really done much for file handling outside of copy and paste C++ and Python methods, but if there's a way to look at the destination folder like a pointer then just pass that as something to ignore from for the copy function. |
Yeah I'll just check if the destination path is the same as source path and if it is make it do nothing. No point in copying the same folder unless it has something different. Perhaps I should add a confirmation dialog for overwriting files. I'll take a look when I get time. |
Also check that the folder your copying to isnt inside the folder your copying. So. Dont copy /switch/edizon to /switch/edizon/files/ as that can get. Problematic. |
Oops commented with my alt account. Another thing that came to mind with the overwrite prompt, would it be relatively easy to offer rename on paste? What originally brought this about was me wanting to copy a folder but hoping it would add something like " - copy" to the end of the name, but instead having to copy it to a temporary directory, rename it, and then move it next to the original folder. |
Solution is very easy - just create list of files to copy before copy and do not use recursion. |
If you attempt to copy some folder A into itself, the result will run infinitely and soft-lock the system. Not sure of the appropriate fix, perhaps a temporary directory to copy files to, and then move them to the final directory, or add an exception to ignore itself when copying. ¯\(ツ)/¯
The text was updated successfully, but these errors were encountered: