Hacker News new | ask | show | jobs
by radiospiel 4125 days ago
Well, dropbox could just listen for fs events inside the DropBox folder; and it should, from a performance perspective as well as from a privacy point of view. And then "sends a few 100 kByte"? I hope this is a typo; if not, I would like to know what these are. (also: the OP's largish file (1MB) could easily fit into "a few 100kByte" after compression)
2 comments

Well, dropbox could just listen for fs events inside the DropBox folder...

On Linux at least [1], this is exactly what the Dropbox client does. It only registers inotify watchers on the $HOME/Dropbox directory and subdirectories. To verify:

    strace -f -e trace=inotify_add_watch dropboxd
You could also strace open/stat/read/write syscalls to verify that, aside from shared libraries and the like, the Dropbox Linux client doesn't access files outside of your Dropbox directory.

Other OSes have different file monitoring capabilities though. Anyone up on file monitoring on Windows / OS X? Is directory-specific monitoring possible?

[1] https://www.dropbox.com/install?os=lnx

> Other OSes have different file monitoring capabilities though. Anyone up on file monitoring on Windows / OS X? Is directory-specific monitoring possible?

yes

But ReadDirectoryChangesW notoriously misses updates. Also it would scale horribly to large amounts of files.

NTFS has a feature called Change Journals where you can view a volume as a stream of changes.

OS X definitely does, it's quite simple and reliable.
Actually, it cannot for the shell extension for the checkboxes over synced files. It needs to look at every file seen with Explorer to do that.
Really? The shell extension could just ask the dropbox daemon if something is known about file x/y/z, and the daemon would answer "no" if the file is outside its folder. No need to look into the file for that. Or did I miss something?
If you look at the analysis posted elsewhere, Dropbox only queries the long-name of the file since apparently Explorer can still send it a short-name version of the file (e.g. "C:\PROGRA~2" instead of "C:\Program Files").