Skip to content

Windows: brename doesn't detect when files will be overwritten if the replacement only differs in case #28

Closed
@tspivey

Description

@tspivey

Using brename v2.12.0 on Windows.
Create two files, test.txt and test.doc.

brename -x -p "\..+$" -r "" -d

[INFO] checking: [ ok ] 'test.doc' -> 'test'
[ERRO] checking: [ overwriting newly renamed path ] 'test.txt' -> 'test'
[ERRO] 1 potential error(s) detected, please check

This works as expected. Now create test.txt and Test.doc.

brename -x -p "\..+$" -r "" -d

[INFO] checking: [ ok ] 'Test.doc' -> 'Test'
[INFO] checking: [ ok ] 'test.txt' -> 'test'
[INFO] 2 path(s) to be renamed

Now do the rename:

brename -x -p "\..+$" -r ""

[INFO] renamed: 'Test.doc' -> 'Test'
[INFO] renamed: 'test.txt' -> 'test'
[INFO] 2 path(s) renamed

Only one file remains in the directory, because NTFS is case insensitive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions