This comment is reply for 391 kawauchi: (ファイル更新の監視). Go to thread root.
kawauchi #399(2007/07/09 15:10 GMT) [ Ruby ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
require 'rubygems' require 'win32/ipc' # http://rubyforge.org/projects/win32utils require 'win32/changenotify' # http://rubyforge.org/projects/win32utils include Win32 exit if ARGV == [] filename = File.expand_path(ARGV[0]) flags = ChangeNotify::FILE_NAME | ChangeNotify::LAST_WRITE | ChangeNotify::SIZE cn = ChangeNotify.new(File.dirname(filename), false, flags) loop { cn.wait(){|sa| sa.each {|st| puts "modified!" if st.file_name == File.basename(filename) } } }
Rating0/0=0.00-0+
[ reply ]
kawauchi #399() [ Ruby ] Rating0/0=0.00
Rating0/0=0.00-0+