cksum: ensure appropriate "binary" mode with --untagged
[coreutils.git] / tests / rm / r-3.sh
blob1f9ec497bb2eda286aca8e6badc25d921797b30e
1 #!/bin/sh
2 # Create and remove a directory with more than 254 files.
4 # Copyright (C) 1997-2024 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <https://www.gnu.org/licenses/>.
20 # An early version of my rewritten rm failed to remove all of
21 # the files on SunOS4 when there were 254 or more in a directory.
23 # And the rm from coreutils-5.0 exposes the same problem when there
24 # are 338 or more files in a directory on a Darwin-6.5 system
26 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
27 print_ver_ rm
29 mkdir t || framework_failure_
30 cd t || framework_failure_
32 # Create 500 files (20 * 25).
33 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j; do
34 files=
35 for j in a b c d e f g h i j k l m n o p q r s t u v w x y; do
36 files="$files $i$j"
37 done
38 touch $files || framework_failure_
39 done
41 test -f 0a || framework_failure_
42 test -f by || framework_failure_
43 cd .. || framework_failure_
45 rm -rf t || fail=1
46 test -d t && fail=1
48 Exit $fail