[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
File::Path::rmtree quirks
Using the File::Path module that comes with 5.005, I found some
bothersome behaviors in rmtree. It has failure modes that are different
from rm -r in surprising ways. Consequently, I think it's bad to
suggest it as a replacement for rm -r.
With $safe off, it attempts chmods that may be unnecessary, and prints
noisy warnings if they fail.
With $safe on, it silently ignores unwritable files, then complains when
parent directories aren't empty.
It attempts to restore permissions, complaining when it fails, even if
$safe is not true.
It will fail on files called "$", even where this does not have special
meaning.
Sorry I can't fix all this, but the messy system-dependent stuff is
daunting, and I decided not to use File::Path due to the problems.
rmtree is useful for many things, and in some cases may succeed where rm
fails, I just think that it must be documented that it may also fail in
surprising ways where rm succeeds.
Andrew
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]