Dropbox

Discussion in 'Mac Programming' started by grimreaper1377, Oct 6, 2008.

  1. grimreaper1377 macrumors regular

    Joined:
    Oct 20, 2007
    #1
    Hi all,

    I was wondering how something like Dropbox could be made. I know it was done in Python, but is it possible to modify folders like that, where you can drag-and-drop files into them so they'll be uploaded automatically?

    Thanks.
     
  2. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    Are you looking for an application to write? Because if not, OS X's built in Folder Actions combined with Automator or AppleScript are probably the easiest way to do that. Unfortunately in Leopard, Folder Actions are pretty flakey and not 100% reliable (sometimes not at all reliable), although some people have had success with them.

    I imagine you could write an app in just about any language that will watch a folder for changes and do something when it finds new files in there, although the methods used for checking the folder may not be that efficient (polling), and you'd probably want something running as a faceless background application or daemon. You could also maybe attach something to a cron job that checks periodically, but again that may not be terribly efficient.

    OS X's launchd services has a nifty feature that will launch one of your scripts when it detects a file system change. Unfortunately, they forgot to provide any mechanism for the called script to find out what part of the file system actually changed, making it almost useless unless you want your script called every time a file or folder is created, moved, renamed, deleted, modified.
     
  3. grimreaper1377 thread starter macrumors regular

    Joined:
    Oct 20, 2007
    #3
    I'm just curious to know how it works.


    So does Dropbox use Applescript/Python combo?
     
  4. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #4
    Don't bump things.

    Chances are Applescript is not involved, since they have clients for OS X, Linux, and Windows. The OS X version could use applescript, but that would mean it's totally different than the other two platforms. I emailed feedback@getdropbox.com. If they respond, i'll post the response here.

    -Lee
     
  5. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #5
    I got a response from the dropbox folks, this was it:
    It sounds like python it is.

    -Lee
     

Share This Page