Making all files lowercase

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: sinck@corp.quepasa.com
日付:  
題目: Making all files lowercase

Ok, just because I can, here's the perl solution I use for exactly
this purpose. It doesn't use the handy tmp dir that JLF uses, but
I've used it and expect it to replace/clobber files in the cwd.

It works for me, but YMMV. :-)


------------------
# down cases the names
opendir(UP,".");
@names=readdir(UP);
closedir(UP);
while ($name=shift(@names))
{
    next if (($name =~ /^[\.]{1,2}/) || ("\L$name" eq $name));
    system ("mv $name \L$name\n");
}
exit 0;
------------------


That test keeps it from trying to lowercase dot-files and from converting
already lowercase files to lowercase.

David