List Info

Thread: Curious win32-changenotify behavior - numbers instead of names




Curious win32-changenotify behavior - numbers instead of names
user name
2006-12-21 02:38:58
Hi all,

Ruby 1.8.5
win32-ipc 0.4.2 (or 0.5.0 in cvs)
win32-changenotify 0.4.2

I noticed something strange tonight while tinkering with 
win32-changenotify.  Here's my sample script:

# cntest.rb
require 'win32/changenotify'
include Win32

path = "C:\test"
filter = ChangeNotify::FILE_NAME | ChangeNotify:IR_NAME

cn = ChangeNotify.new(path, true, filter)
cn.wait{ |arr|
    arr.each{ |e|
       p e
    }
} while true

cn.close

I then created a file called "test.txt" with gvim,
and occasionally did 
":w" to save it.  The weird thing is that
sometimes I get the actual 
file name, and sometimes I get a strange number.  Any idea
what's 
causing it?

#<struct Struct::ChangeNotifyStruct
action="added", file_name="test.txt">
#<struct Struct::ChangeNotifyStruct
action="added", file_name="4913">
#<struct Struct::ChangeNotifyStruct
action="added", file_name="4913">
#<struct Struct::ChangeNotifyStruct
action="added", file_name="4913">
#<struct Struct::ChangeNotifyStruct
action="removed", 
file_name=".test.txt.swo">

Any ideas?

- Dan
_______________________________________________
win32utils-devel mailing list
win32utils-develrubyforge.org
http://rubyforge.org/mailman/listinfo/win32utils-devel

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )