I’ve written a Ruby script that scans a directory for new files at a
specified interval, using Directory_Watcher (Thanks for the great gem
Pease!), and when a new file is added to the directory - it streams it
to my Web Application.
The problem I’m having is with large files that take a long time to copy
into a folder in Windows, the file is added and picked up immediately
the application tries to begin streaming, but ends up getting a
“Errno::EACCES: Permission denied” on the file because it is still being
I’ve been trying to find a way to test a file in windows to see if it is
readable/writable? I’ve tried all of the usual ruby methods:
File.size = reports the total size of the file, even if its still
File.readable? ==> always returns true even during the copy
File.writeable? ==> always returns true even during the copy.
So I guess my question is: Does anyone know how to test if a file is
complete in Windows?