uutils/coreutils

rm --one-file-system should fail wih `rm: skipping 'a/b', since it's on a different device`

クローズ

#7,011 opened on 2024/12/28

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (2,003 件のフォーク)batch import
U - rmgood first issue

Repository metrics

Stars
 (23,978 個のスター)
PR merge metrics
 (平均マージ 5d 23h) (30d で 239 merged PRs)

説明

t=/tmp/a2323
mkdir -p a/b $t/y
sudo mount --bind $t a/b
../gnu/src/rm --one-file-system -rf a
./target/debug/coreutils rm --one-file-system -rf a
sudo umount a/b /tmp/a2323

currently returns: rm: cannot remove 'a': Device or resource busy (os error 16)

when it should return: rm: skipping 'a/b', since it's on a different device

it will probably requires a new function to investigate all files/directories to be removed. (fortunately, will be only called with --one-file-system)

Note that it should not regress:

mkdir -p a42/b
./target/debug/coreutils rm --one-file-system -rf a42 || fail=1
echo $fail

tested by upstream: bash util/run-gnu-test.sh tests/rm/one-file-system.sh tests/rm/one-file-system2

コントリビューターガイド