Share files at arbitrary locations by Dropbox

dropbox

I would like to have a terminal tool which would allow me to share files at arbitrary locations by Dropbox. For instance, by

dropbox /users/cs/python/codes/1.py

This should share the file at the given location.

Let's assume that we have the file 1.html at ~/Dropbox/public. It has a link to the file which dropbox above.

This suggests me that the Dropboxed-files should be also at the public folder. However, the name of the file in the Dropbox folder should suggests Dropbox to get data from the given location.

I am not sure whether this is possible or not: My point is to have a code in the filename such that Dropbox could fetch the data from the given location after reading the filename.

How can you share files at arbitrary locations by Dropbox?

Best Answer

I can't understand exactly what you're asking, but if you want to have files show up in the Dropbox Public folder and also be somewhere else in the filesystem, it looks like the only option for now is hard links (on *nix operating systems, including OS X):

ln /users/cs/python/codes/1.py ~/Dropbox/Public/

That will create a 1.py file in ~/Dropbox/Public which will be another link to the same file on the filesystem, though it will look like another file. This means you can access the file the same way, and any changes you make to one will be the same with the other (since they're accessing the same location on disk). You can later delete the link in the ~/Dropbox/Public folder, and the other one will still work. Take note: if you delete one of the links and recreate the file there, they will no longer be pointing to the same location on disk.

Related Question