uutils / uutils/coreutils

mv: moving(renaming) case-sensitive files errors out on macOS

Open
#5,451 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

U - mv
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Hi,
Two main issues occur when renaming files/directories on macOS.

Platform: macOS
mv version: 0.0.22

rename_directory

mkdir somedir
touch somedir/somefile.txt
> uutils mv somedir Somedir
# mv: cannot move 'somedir' to a subdirectory of itself, 'somedir/somedir'

rename_file

touch samefile.txt
> uutils mv samefile.txt Samefile.txt
# mv: 'somefile.txt' and 'Samefile.txt' are the same file.

Expected behavior:
Same as Linux, to rename both dir/files rather than error out. Not sure what the behavior is on Windows. This was raised originally on nushell's PR, specifically comment

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the directory and file rename commands from the issue on macOS, then compare their behavior with Linux. Trace the mv implementation and its handling of case-only renames, and verify that both examples rename successfully without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.