From: Eleanor McHugh Date: 2009-06-29T07:24:30+09:00 Subject: Re: Need Advice Help On Parsing A File On 28 Jun 2009, at 18:44, Mrmaster Mrmaster wrote: > Hi Everyone, > > Thank you for the great advice and especially on the hint of (IO#tell > and IO#seek). > > Robert would you happen to know how I may tell if the file has been > updated/modified? No user would touch the script/email server. I just > need to know how to tell if new email have come in. > > So far all i can think of is setting the script to run at a 10 or some > other second interval and starting from the last known position. Depending on the way the file system's configured, you could probably get by on checking the file access timestamp or if not the file size. File::Stat is probably a good place to start looking. On some platforms it's also possible to get the OS kernel to inform you when a filesystem change occurs (dnotify or inotify on linux, kqueue on BSDs, etc.) so you could also do a search for Ruby plug-ins that patch into those subsystems, but it's probably overkill for what you're trying to do. Ellie Eleanor McHugh Games With Brains http://slides.games-with-brains.net http://www.linkedin.com/in/eleanormchugh