#perl - Thu 1 Mar 2007 between 11:07 and 11:12



hobbs(yet)
merlynwe're solving the problem by going up a level, remember
don't lock in that level of solutio
you might have an XY here.
perlygatekeeperMerlyn!
merlynor perhaps an XYZ :)
perlygatekeeper! :)
wearygoing up a level requires lots of people to co-operate..
hobbsperhaps even a pgk
zakamelayers of cake :)
integralThe best solution obviously is to get syslog to fork an new instance of perl on every single message. (sigh)
wearyi'll just go think of something completely else. thanks for your help!
merlynmaybe if you explain precisely why you need to wake up out of nowhere repeatedly, and find the last line of a file, we could help
that just seems like having to reproduce a lot of work each time
when it should be something that just lives in a long-running daemon
integralhmm, isn't that what tail -f does? and File::Tail? And that Poe tail wheel thing
merlynthe latter, yes
he's sayign he doesn't want a long-running daemon
actionintegral is surprised linux still doesn't have a waitfornewdataonfile syscall yet
integralis surprised linux still doesn't have a waitfornewdataonfile syscall yet
wearyi need something that opens a file, reads the last B bytes, finds the last line in the bytes, if it needs removing resize the file.
LeoNerdintegral: dnotify?
integralhmm, maybe!
LeoNerdOh except it's called inotify now
merlynwhat if you're trying to remove it while something else wants to write something new?
integraloh, I thought inotify was the old name, doh.
merlynhow do you get exclusive access to the file?
LeoNerdinotify is really what you want.. it's entirely suited to this
integralthere's already programs that do log rotation
LeoNerdinotify is the new system, that gets around issues with the old one
dnotify watches filehandles.
wearymerlyn: err, good point
LeoNerdinotify can do names, too
integraliirc the issue was having an insanely sucky interface
merlynso my guess is that really, you'll be copying this file to another place
LeoNerdYou can be informed when a filename gets created, unlinked,.. renamed... as well as all the data stuff within one filehandle
merlynin which case, you'll want a long-runing daemon
and then, you can use File::Tail
LeoNerdinotify is very shiney :)
wearyno, that's not going to work (for non-programming related reasons). I'll go think up something else.
merlynit can't possibly be any better. :)

Page: 4 11 18 25 32 39 46 53 60 67 74 81 88 

IrcArchive