[#30549] [ANN] Ruby 1.8.6 has been released — "Akinori MUSHA" <knu@...>

 Ruby 1.8.6 をリリースしました。

14 messages 2007/03/12

[#30553] help: lib/shell for ruby 1.9 — keiju@... (Keiju ISHITSUKA)

けいじゅ@いしつかです.

13 messages 2007/03/13
[#30585] Re: help: lib/shell for ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/03/15

まつもと ゆきひろです

[#30587] Re: help: lib/shell for ruby 1.9 — keiju@... (石塚圭樹) 2007/03/15

けいじゅ@いしつかです.

[#30588] Re: help: lib/shell for ruby 1.9 — Yukihiro Matsumoto <matz@...> 2007/03/15

まつもと ゆきひろです

[ruby-dev:30477] ThreadError on shell.rb

From: "Akira ODA" <oda.org@...>
Date: 2007-03-04 01:48:35 UTC
List: ruby-dev #30477
はじめまして、尾田といいます。

shell.rb を使ったちょっとしたスクリプトを書いて大量のファイル(3000ファイル; 11GB)を
処理していたら途中で止まってしまいました。

スクリプト自体に問題はないと思うので、一応報告まで。
以下、スタックトレースと停止したスクリプトです。

require 'pathname'
require 'shell'
require 'optparse'

def main(from, to, debug, commands)
   files = []
   from.find do |path|
      files << path if path.file?
   end

   if debug > 0
      STDERR.puts "from_dir = #{from.to_s}"
      STDERR.puts "to_dir = #{to.to_s}"
   end

   files.sort.each do |file|
      dest = to + file.relative_path_from(from)
      dest.parent.mkpath

      if debug > 0
         STDERR.puts "input = #{file.to_s}"
         STDERR.puts "output = #{dest.to_s}"
      end

      Shell.new.transact do
         cat(file.to_s) | system(*commands) > dest.to_s
      end
   end
end

if $0 == __FILE__
   from = nil
   to = nil
   debug = 0

   opt = OptionParser.new
   opt.on('-t', '--to TO', String) {|v| to = Pathname.new v}
   opt.on('-f', '--from FROM', String) {|v| from = Pathname.new v}
   opt.on('-d', '--debug') { debug += 1 }
   opt.parse!(ARGV)

   unless from and to and ARGV.length > 0
      puts opt.help
      exit
   end

   main(from, to, debug, ARGV)
end

/home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/thread.rb:203:in
`stop': stopping only thread (ThreadError)
        note: use sleep to stop forever from
/home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/thread.rb:203:in `wait'
        from /home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/thread.rb:155:in
`exclusive_unlock'
        from /home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/thread.rb:33:in
`exclusive'
        from /home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/thread.rb:147:in
`exclusive_unlock'
        from /home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/thread.rb:201:in
`wait'
        from /home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/shell/process-controller.rb:185:in
`wait_all_jobs_execution'
        from /home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/thread.rb:135:in
`synchronize'
        from /home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/shell/process-controller.rb:182:in
`wait_all_jobs_execution'
        from /home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/shell/command-processor.rb:246:in
`check_point'
        from /home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/shell/command-processor.rb:254:in
`transact'
        from /home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/shell/command-processor.rb:519:in
`__send__'
        from /home/oda/opt/stow/ruby-1.8.5-p12/lib/ruby/1.8/shell/command-processor.rb:519:in
`transact'
        from ./bin/dir_filter.rb:27:in `main'
        from ./bin/dir_filter.rb:18:in `each'
        from ./bin/dir_filter.rb:18:in `main'

-- 
Akira ODA <oda.org@gmail.com>

In This Thread

Prev Next