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

Bug: Files with same name in recursive operations #25

Open
FrederikSchaff opened this issue Jan 12, 2023 · 2 comments
Open

Bug: Files with same name in recursive operations #25

FrederikSchaff opened this issue Jan 12, 2023 · 2 comments

Comments

@FrederikSchaff
Copy link

Hi there,

first: Thanks for this great tool!

I have found a small bug related to recursive operations, I have not completely analysed it yet.

MWE:

test/
|
|-- test-file.txt
|-- test-2/
     |-- test-file.txt     
     |-- test-3/
          |-- test-file.txt     

In /test folder: stdrename -tDr (also other alternatives)

Expected:

test/
|
|-- Test File.txt
|-- Test 2/
     |-- Test File.txt     
     |-- Test 3/
          |-- Test File.txt     

Actual (after first run):

test/
|
|-- test-file.txt
|-- Test2/
     |-- test-file.txt     
     |-- test-3/
          |-- test-file.txt     

(os error 3) (I currentöy have german language error messages, basically: The OS cannot find the provided path)
After another run:

test/
|
|-- test-file.txt
|-- Test2/
     |-- test-file.txt     
     |-- Test3/
          |-- test-file.txt     

same error, and then again another run;
Success (with bug, see below):

2 files renamed in 0.001352 s. See you next time!
Actually 3 files and another folder have been renamed.

test/
|
|-- Test File.txt
|-- Test2/
     |-- Test File.txt     
     |-- Test3/
          |-- Test File.txt     

The problems are probably in the area:

  • Parsing/interpreting number symbols in folder names
  • Multiple files with the same name

If I now on the changed structure use stdrename -kDr to revert the changes, I get

test/
|
|-- test-file.txt
|-- test-2/
     |-- Test File.txt     
     |-- Test3/
          |-- Test File.txt     

Same error (os 3)

Next time:

test/
|
|-- test-file.txt
|-- test-2/
     |-- test-file.txt     
     |-- test-3/
          |-- Test File.txt     

Same error (os 3)

Last (3rd) time;

test/
|
|-- test-file.txt
|-- test-2/
     |-- test-file.txt     
     |-- test-3/
          |-- test-file.txt     

1 files renamed in 0.00111 s. See you next time!

So the operations are revertable.

Hope this helps!

@FrederikSchaff
Copy link
Author

Workaround (not fixing Test 2 -> Test2 issue, i.e. removing space before numbers:
Re-run command until no more failure

@Gadiguibou
Copy link
Owner

Hi there! Thank you so much for the detailed bug report! I'll try to take a look at this in the week to come.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants