# File lib/eventmachine.rb, line 1263
1263:   def self.watch_file(filename, handler=nil, *args)
1264:     klass = klass_from_handler(FileWatch, handler, *args)
1265: 
1266:     s = EM::watch_filename(filename)
1267:     c = klass.new s, *args
1268:     # we have to set the path like this because of how Connection.new works
1269:     c.instance_variable_set("@path", filename)
1270:     @conns[s] = c
1271:     block_given? and yield c
1272:     c
1273:   end