Page 1 of 1

Hazel moving a file before Google Drive has fully downloaded

PostPosted: Tue Oct 11, 2016 11:12 am
by FoodandWhining
Hopefully the subject says it all and this hasn't already been answered (yes, I checked.)

I frequently save images from my phone to Google Drive which gets synced with my computer and Hazel's job is to route it to the right place. For a year, I've been getting zero k files on my computer but the images are fine on my phone. It finally clicked that Hazel might be moving them before they're "complete" files.

This seems to have been an issue for a while in other places. Is there a flag that gets set when a file begins downloading and then gets changed to "ready" once it's complete? Maybe a way to say "make sure the file has been there for X minutes, and THEN move it"?

Re: Hazel moving a file before Google Drive has fully downlo

PostPosted: Wed Oct 12, 2016 11:20 am
by Mr_Noodle
Note that there is a somewhat standard way to lock a file so that other programs don't mess with it. Hazel observes this lock but many apps (especially those that are "cross platform") do not set it.

In absence of that, you can add a condition like "Date modified is not in the last X minutes" to delay a match until some time after it was last touched.

Re: Hazel moving a file before Google Drive has fully downlo

PostPosted: Wed Oct 12, 2016 11:34 am
by FoodandWhining
Mr_Noodle wrote:Note that there is a somewhat standard way to lock a file so that other programs don't mess with it. Hazel observes this lock but many apps (especially those that are "cross platform") do not set it.


I guess much depends on how GDrive creates a file being synced. If it creates a "container", and then gradually adds to that container, that might be confusing Hazel. Once Hazel "sees" a file, it grabs it and moves it and there's nothing in the container yet. This seems like it would be a more overarching problem between Hazel and GDrive or any other application that syncs?


Mr_Noodle wrote:In absence of that, you can add a condition like "Date modified is not in the last X minutes" to delay a match until some time after it was last touched.


Brilliant! Will give that a shot!

Re: Hazel moving a file before Google Drive has fully downlo

PostPosted: Thu Oct 13, 2016 10:55 am
by Mr_Noodle
A possibility. I'll need to test it but I believe the locking can be done on a directory as well.