Apple’s OS X has one “feature” which periodically causes me a lot of grief. Not often, because once I have fallen over it, it takes several years until I forget and make the mistake again. I use Windows PCs at work, and there, if I copy a directory’s contents into another directory, it effectively merges the source directory files with those in the target directory.
OS X however treats each folder as a single object and replaces the complete contents of the target folder with the contents of the source directory. This usually catches me out when I decide to update my local (test environment) WordPress installation with the latest and greatest version of WordPress. The standard way to do this is to copy the new kit containing all of the WordPress files and sub-directories into the folder where the test site is installed. In the target folder containing my test installation there are, however, a few extra files that aren’t part of the WordPress installation kit – configuration files, the site favicon.ico file and one or two other files and folders. An OS X copy command deletes these without even stopping and asking if that is what I intend to do. Time to be glad that I run Time Machine in the background and can usually restore the missing stuff in a couple of minutes. But very annoying.
The solution is first of all to remember about this nasty difference between Windows and OS X. Then, I ideally need a way to perform a Windows type of copy, which OS X considers to be a folder-merge. The best solution I have found is to download the mergefolders script. This little script can be stored anywhere and dragged to the dock where it sits, waiting to be run. It asks the names of source and target folders and then performs the necessary merge into the the target folder, just like Windows.
If you want to read up a bit about this difference between the way the two operating systems perform a copy, then look here and if a summary of all the differences between OS X and Windows Vista is what you are looking for, you can find that here.






