开发者

Using Dropbox's python API to detect changes

开发者 https://www.devze.com 2023-03-20 05:45 出处:网络
How would I go about detecting if a file changed, using Drop开发者_JAVA技巧box\'s python API?I can\'t simply check the file on disk because it won\'t be updated if it\'s in use.The best way to do this

How would I go about detecting if a file changed, using Drop开发者_JAVA技巧box's python API? I can't simply check the file on disk because it won't be updated if it's in use.


The best way to do this would be to use the files hash that you get from the Metadata call of the API. You should then store this hash locally.

The Metadata API call can also take a metadata parameter which will make it return a 304 (Not Modified) status if the file has not changed. (more info: https://www.dropbox.com/developers/reference/api#metadata)

But this method still requires you to poll the API constantly.

0

精彩评论

暂无评论...
验证码 换一张
取 消