[mew-dist 28158] Re: V と ^

Hideyuki SHIRAI ( 白井秀行 ) shirai at example.com
2008年 3月 13日 (木) 18:34:23 JST


Ruby 全然わからないから確かめながらやりました。

From: Kazu Yamamoto (山本和彦) <kazu at example.com> さん曰く
Subject: [mew-dist 28156] Re: V と ^
Message-ID: <20080313.182031.185627676.kazu at example.com>
Date: Thu, 13 Mar 2008 18:20:31 +0900 (JST)

> >  ・folder/.mew-mtime の mtime を見て、フォルダをスキップしている
> >    のだけど、その後の判定が結局はメッセージの mtime に依存してい
> >    るので、スキップしたフォルダに含まれるメールは読み飛ばすよう
> >    にした。
> 
> ディレクトリで next すると、そのディレクトリに入っているファイルは自動
> 的にスキップされていませんか?

いや、だめですよ。さっきので、

    elsif FileTest.directory?(fpath)
      next if FileTest.symlink?(fpath)
      print fpath
      mtime_file = File.expand_path('.mew-mtime', fpath)
      if FileTest.file?(mtime_file) and last_mod > File.mtime(mtime_file).tv_sec
        print " (skipped)\n"
        skip_dirs.push(fpath)
        next
      else
    .....
    elsif FileTest.file?(fpath) and fpath =~ /\/[0-9]+(\.mew)?$/
      if skip_dirs.include?(File.dirname(fpath))
        print "no skip: ", fpath, "\n"
      end
      
ってやると、

% cmew
.
./queue.gmail (ignored)
./white (skipped)
no skip: ./white/99
no skip: ./white/98
no skip: ./white/97
no skip: ./white/96
no skip: ./white/95
...

ってなります。

> そういう意味じゃないのかな?

>> `next'はもっとも内側のループの次の繰り返しにジャンプします.

とのことなので、ディレクトリとかはまったく関係ない様です。

ちなみに、Find.prune だと sub folder も飛んじゃって NG。

-- 
白井秀行 (mailto:shirai at example.com)



Mew-dist メーリングリストの案内