On Sat, 2010-10-23 at 12:27 +0100, Marko Vojinovic wrote: > On Saturday, October 23, 2010 04:27:45 Patrick O'Callaghan wrote: > > On Thu, 2010-10-21 at 21:33 -0600, Petrus de Calguarium wrote: > > > Fortunately, Suvayu's brilliant script gets around that and manages to > > > access the file, even though it is already deleted, while Patrick's > > > suggestion of hard linking to it does not work, because it is already > > > deleted, unless he also has some ingenious trick up his sleeve to "get a > > > handle on" the deleted file. > > > > Yes, it's a neat trick. However the 'cp' will terminate when it reaches > > the end of the input file, even if it's still being written to by the > > flash process. That would explain why the output is sometimes truncated. > > Getting round that would need a copy process that waits to see if > > there's more output, either by polling or by using inotify. IOW > > something conceptually similar to "tail -f". > > Just to follow that idea, would something like > > tail -f /proc/<pid>/fd/<file_id> > /tmp/flashfile.flv > > work? (Maybe with a couple more switches to tail, to start from the beginning > of the file, etc...) I suspect that 'tail' is designed for text files (it has options for how many lines to output etc.) 'man tail' is not very clear on whether it can work for binary files, e.g. what happens when it gets a null byte in the stream? Some experimentation is in order. Also, 'tail -f' will sit forever waiting for input, even if nothing is writing to the file. The present case is slightly different in that we can assume (until Adobe changes it again ...) that a single process is writing to the Flash buffer file, hence the idea of using inotify to notice when the writer has gone. However on second thoughts that may not be necessary. Given that the /proc file will disappear when the writer dies, it would be enough to loop until getting an error (EIO?, not sure). poc -- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines