With filenames varying between only one and five characters in
length, it was fairly easy to get two files differing only in
case ('A' and 'a', for example). Which on non-case-sensitive file
systems could generate a warning at unlink time because it would
unlink 'a' and then check for the existence of 'a' and get true
because 'A' was still there and indistinguishable from 'a'.
So just use longer filenames to make the possibility of collision
vanishingly small.
sub make_some_files {
for (1..int rand 10) {
my $name;
- $name .= $chars[rand $#chars] for 1..int(1 + rand 5);
+ $name .= $chars[rand $#chars] for 1..int(10 + rand 5);
make_file($name);
}
}