-
Notifications
You must be signed in to change notification settings - Fork 399
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
Analyze the renaming order of bulk-renamed files to avoid conflicts #1766
Comments
I don't think using temporary filenames is a good idea because it breaks the atomic operation Since the filesystem doesn't have the concept of transactions, all I/O operations are prone to failure. This could introduce unexpected security risks, as either of these two steps could fail. I believe a better approach would be to come up with an algorithm that automatically analyzes the order in which files should be renamed. For example, in the case of:
The renaming operations should be done in the order:
Anyone want to give it a try? All the code for bulk renaming can be found in |
Hi, I am an open source beginner looking for a good issue to contribute to for the first time. Can I try to handle this issue? As you mentioned above, I think this problem can be solved by determining the order of rename using topological sort. |
Sure, go for it! If you need any guidance, just let me know @yw1ee! |
I'm going to lock this issue because it has been closed for 30 days. ⏳ |
yazi --debug
outputPlease describe the problem you're trying to solve
when trying to bulk rename files yazi skips renaming if desnination file already exists, even if you were going to rename the destinatoin too
this does not work as expected even though there is no conflict:
this makes doing something like incrementing numbers in files in bulk harder to do
Would you be willing to contribute this feature?
Describe the solution you'd like
use temp/intermediate files if destination exists and is scheduled to be renamed:
or reshuffle rename execution:
(i recommend using temp files since it also takes care of swapping files)
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: