File replacement behaviour

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

Moderator: Mr_Noodle

File replacement behaviour Fri Apr 17, 2020 12:34 am • by LeeB
I'm using Hazel as part of an automation workflow for one of our platforms that doesn't have an API.

- A workflow extracts some reports for me from one of our systems and puts them in the Downloads directory.
- Hazel then monitors, renames the files and then moves them to a local Box.com directory.
- Then our BI platform monitors the file in Box and pulls updates ever hour.

Unfortunately this doesn't work and I think it's related to how Hazel handles the replace function. If I rename the file manually and then copy it into Box and select replace the file is versioned in Box and all is good.

With Hazel it appears as a new file, this reflects the behaviour of it you deleted the file from Box and then copy a file of the same name. From Boxs point of view it's a new file and gets a new unique file ID. So pondering if there is a way to resolve this with Hazel?
LeeB
 
Posts: 1
Joined: Fri Apr 17, 2020 12:27 am

Re: File replacement behaviour Fri Apr 17, 2020 10:09 am • by Mr_Noodle
In general, when copying, Hazel will copy to a temp location then move that file over afterwards. This is usually considered safer as at no point are any files in an inconsistent state. I find it odd that Box would be so overly literal with it's handling of file identities. Note that replacing the file with a new one is very common on macOS (for example, many apps do it when writing out their files) so it's seems like less than ideal behavior on their part.
Mr_Noodle
Site Admin
 
Posts: 11870
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support