Re: quasi-[OT] Adobe Flash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Patrick and Marko,

On Saturday 23 October 2010 03:51 PM, Patrick O'Callaghan wrote:
> I tried it using inotifywait(1), but it never terminates, i.e. the flash
> file persists even after the video has finished. I suspect it will stay
> there till a new video starts or the flash plugin (i.e. the browser
> process) dies.
>

I think I know what is going on. See my explanation below and please
comment. :)

> tail -f -q --bytes=1G --pid=${pid} $in_file>  $out_file&

Firstly that `--pid=${pid}' needs to be removed otherwise it waits for
the browser to exit. But even that won't help.

When the script executes the above command, another file descriptor is
opened under the pid for tail. This stays linked to the (deleted)
/tmp/FlashXXXX file even after the link under the browser's pid has
been deleted and inotify keeps waiting for the original file to be
deleted!

I think if we can monitor the link itself (which is probably not what
inotify does) then we would have a winner.

> inotifywait -e delete $in_file 2>  /dev/null

Also I think delete_self might be a better event to watch for.

> sleep 5	# Wait for buffer to flush. Is this necessary?

This is probably not necessary. Strangely the answer lies in the man
page for a variation of the tail utility, `man 1 tailf'.

To quote:

... It is similar to tail -f but does not access the file when it is
not growing. This has the side effect of not updating the access time
for the file, so a filesystem flush does not occur periodically when
no log activity is happening.

> poc

This is turning out to be a rather fascinating discussion. :) Learned a 
lot thanks to you all.

-- 
Suvayu

Open source is the future. It sets us free.
-- 
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

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux