From: Robert Klemme Date: 2009-04-28T18:17:32+09:00 Subject: Re: How Check File Busy? 2009/4/28 Greg Willits : > Marc Heiler wrote: >> Do you require this on a local machine, or only via FTP? >> >> I think FTP is extremely limited - not sure if it allows that much. > > Sorry, clarification.... all ruby work is local. It just so happens that > for the file move, the source folder functions as an FTP target, but > I'll be working with it locally. So, the entire move process is a local > file system, it's just that the source files may be in the middle of > being uploaded (they're large, and take several minutes to transfer in). IMHO it's difficult to detect that. You could use shell utility "fuser" if available on your platform. In a shell script you could do while fuser "$file" >/dev/null; do sleep 1 done cp "$file" "$somewhere_else" Maybe you can use an FTP server which allows to trigger post processing after an upload has finished. I am not sure about FTP library, but if it contains a server part you might even be able to cook one yourself. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/