From: Takahiro Kambe Date: 2007-05-24T22:27:38+09:00 Subject: [ruby-dev:30811] Re: FileUtils.rm_rf misfeature? In message <200705240140.l4O1etRE024838@sharui.nakada.kanuma.tochigi.jp> on Thu, 24 May 2007 10:40:56 +0900, Nobuyoshi Nakada wrote: > > Will your patch be applied to the archives? It seems to work as I > > would have expected for "rm_rf". And for "rm_f" too, that had the same > > problem. > > ENOENTだけを無視するrm -fと違って、FileUtils.rm_rfやrm_fがすべ > てのエラーを無視している、という件ですが、これは意図的な違いで > しょうか。とくに理由があるのでなければ、合わせたほうが望ましい > のではないかと思うのですが。 NetBSD 3.1_STABLE(およびcurrent)のrm(1)の互換性のところでは、 The rm utility differs from historical implementations in that the -f option only masks attempts to remove non-existent files instead of mask- ing a large variety of errors. といった記述もあります。そして、現在の実装では、 ENOENT ENAMETOOLONG ENOTDIR を無視しています。元のやりとりにもよると思いますが、案外環境によって rm(1)の-fオプションの実装も違うという場合もありそうです。 FreeBSD 6.2-STABLEでは、ENOENTだけを無視しています。 以上、ご参考までに。 -- 神戸 隆博(かんべ たかひろ) at 仕事場