Java guy starts to work on Cocoa - About folder sync

Discussion in 'Mac Programming' started by sparklo, Oct 13, 2011.

  1. sparklo macrumors newbie

    Joined:
    Mar 30, 2011
    #1
    Hey guys, I am new to the Mac dev world. I have recently taken over a project to write a folder synchronization app in Mac. It's nothing fancy, just to make it to be able to locally synchronize files between two folders.

    I have a bit background with iOS development in the past, familiar with Objective-C on the grammar level. To start with a project like this, I would like to ask for some suggestions on where I should start. Are their any similar open source projects or frameworks that I can get help with?

    Any suggestions will be really appreciated. Thanks!
     
  2. MorphingDragon macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #2
    You could write the program as GUI front end for rsync. That way it could also synchronise over any two computers that have ssh access. Then run a daemon or use crond to run the rsync jobs periodically.
     
  3. whooleytoo macrumors 603

    whooleytoo

    Joined:
    Aug 2, 2002
    Location:
    Cork, Ireland.
    #3
    MorphingDragon's suggestion above is a good one.

    If you're keen on a Cocoa/Obj-C approach, you could look at the NSFileManager and NSWorkspace classes; while using the filepath-building methods in NSString.

    From memory, there's limited progress info/feedback with those classes.. you could also look at the Carbon file handling APIs, but they're not the easiest, nor really the most forward-looking API to use.
     
  4. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #4
    Just for the OP who's new to Mac OS X, I'll link to the Carbon (API) page in Wikipedia to provide the necessary background to understand this.

    In short, Apple has determined that the Objective-C-based Cocoa API is the future on Mac OS X. The GUI part of the C-based Carbon API has been deprecated since Mac OS X 10.5 and doesn't exist at all for 64-bit apps. Although the other aspects of the Carbon API are not formally deprecated, there is a cloud of doubt around them.
     
  5. sparklo thread starter macrumors newbie

    Joined:
    Mar 30, 2011
    #5
    Thanks guys for the very helpful information.

    I think I will start with MorphingDragon's suggestion and do it so for the prototype. And later go with the objective-c approach as it's likely to be more customizable.
     
  6. MorphingDragon, Oct 14, 2011
    Last edited: Oct 14, 2011

    MorphingDragon macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #6
    In all honestly why?

    As a Java programmer you should know that the major strength of any programming language is code-reusability. Why reinvent the wheel when most of the heavy lifting is done for you:

    http://sourceforge.net/projects/librsync/

    A major drawback of OSS software is Usability. Why spend all that time writing unnecessary code when you could work on designing and improving the UI and extending rsync to meet your needs.
     

Share This Page