Hazel moving a file before Google Drive has fully downloaded

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

Moderator: Mr_Noodle

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"?
FoodandWhining
 
Posts: 2
Joined: Tue Oct 11, 2016 11:06 am

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.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

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!
FoodandWhining
 
Posts: 2
Joined: Tue Oct 11, 2016 11:06 am

A possibility. I'll need to test it but I believe the locking can be done on a directory as well.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support