3 ms·
It's late and maybe I missed something looking through the code, but what happens if you don't have write permissions on the directory that the statefile is in?
by kevan 11y ago
It's late and maybe I missed something looking through the code, but what happens if you don't have write permissions on the directory that the statefile is in? The copy operation is performed but then the state is lost when the statefile rename fails.
- stargrave 11y agoAt first, temporary file created in current directory. So if directory is not writable -- temporary file creation at the very beginning will fail.
- kevan 11y agoAh, that's what I missed. I guess there's still a possibility of permissions changing during the transfer, but I don't think there's anything you'd want to do to handle that other than error out.
- stargrave 11y agoIn that case I will print the message telling that something went wrong but temporary statefile is alive: https://github.com/stargrave/syncer/blob/master/syncer.go#L205 https://github.com/stargrave/syncer/blob/master/syncer.go#L2...