Watch continuously written files

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Watch continuously written files Fri Jan 18, 2013 9:10 am • by Jup
I'm using the tivi.tv app to watch and record tv movies. Tizi is using ONE folder for recording and writes continuously (append)into it's file during the recording. You can even use VLC to play it during the recording. It is possible to determine when the writing has been finished (no more data will be written) to process this file with Hazel?
Jup
 
Posts: 6
Joined: Sun Jan 06, 2013 10:57 am

Re: Watch continuously written files Mon Jan 21, 2013 6:30 pm • by a_freyer
That completely depends on your program. Generally speaking, programs that continually write to files will mark the file as locked. If this is the case, the Hazel will skip the file until it is unlocked.

If this is not the case, you could use a rule that includes something like this:

Code: Select all
if (all) of the following conditions are met for (the file or folder being processed):
     date last modified is not in the last 1 minute

Do the following to the matched file or folder:
     …
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Watch continuously written files Tue Jan 22, 2013 6:50 am • by Jup
The file isn't locked and the way you describes was in my mind too. The question is, when Hazel will get control and check the file. For every byte written? In this case I would need some delay like: "check it every 5 minutes" to avoid a slowdown in processing (that could hurt the video stream).
Jup
 
Posts: 6
Joined: Sun Jan 06, 2013 10:57 am

Re: Watch continuously written files Tue Jan 22, 2013 1:47 pm • by Mr_Noodle
It depends on the file event system, which is more at the OS level. Hazel will try and wake up for busy files on its own schedule, and that uses a back-off timer (the intervals get longer the longer it's busy). In this case, though, it will probably get woken up more frequently based on how often data is flushed to the filesystem. I'd test it out as it may not be resource-intensive in actual use.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support