The Blog

The most idiotic design decision in Unix/Mac OS X

If you’re a Windows user: Don’t try moving a folder on top of another with the same name – Mac OS X will replace the entire folder, i.e., it will not merge both folder’s contents and will cause you to lose your data. This is a very significant difference between the Finder and Windows Explorer that catches most people at least once, and is simply a matter of different traditions (plus the UNIX underpinnings of Mac OS X, where things have worked like this from time immemorial). Drag the folder contents, not the folder itself.

Who ever decided folder copy should work like this should be shot dead.

Banca

Banca

Beautiful and functional currency converter, supports just about any currency in the world.

Go Couch to 5k

Go Couch to 5k

The most popular starter running program in beautiful feature-rich app (GPS tracking, charts, detailed history etc)

Quickie to do

Quickie to do

The fastest short-term task-list / check-list app on the App Store. Really.

Guerrilla Cardio

Guerrilla Cardio

The most challenging high-impulse interval training in the world.

Run Mate

Run Mate

A versatile running coach app, with unlimited number of running programs. Perfect for casual runners.

13 Comments

Feel free to chime in, looking forward to it. Leave a Comment

  1. John P says:

    What are you talking about. On my instance of leopard, if I move a folder “foo” on top of “foo”, the moved folder ends up in the target folder. No data are lost.

  2. matthijs says:

    Don’t think I can agree with you. When I copy a file to a place were a file with the same name already exists, it’ll be replaced. That’s the same on windows and os x. So I wouldn’t expect it to be differently for folders. To be honest, I wasn’t even aware of the fact that you could “merge” folders in Windows Explorer…
    And when I try to replace a folder I do get a warning message that a folder with the same name already exists. So I don’t see the problem. When you click “replace” after the question whether you want to replace the folder, isn’t it logical you lost the old folder?

  3. Aleksandar says:

    I’m sure there are people that are used to this. But…

    Consider this: a web developer prepares a small update for a large web site. Update spans 40 files across 1520 folders in various levels of hierarchy depth.

    How would you approach publishing this? I usually gather a patch set, where each file is on the place where it should be, and do a copy to site root.
    On Mac, that would kill entire web site.

    What is the other option? Copy file by file? Use IDE with integrated publishing option (which I don’t, none I tried suits me well)?

    Problem is that there is no “Update” option in the dialog box. You can only Replace the entire contents or give up.

    Please enlighten me if there is another way, I feel like I’m gonna go nuts with this.

  4. Aleksandar says:

    John, if you have Home/x/y/ and Home/z/y/ and you try to copy “y” from x to z, it doesn’t asks you to “do you want to replace it”?

  5. Tim Connor says:

    Alek — welcome to the world of Unix that most of us have been dealing with for hosting the whole time. :)

    I’d rarely updated a website by just copying over samba anyways, or from an archive. First preference is always to use svn/svk/git or some other SCM — not versioning something like a live website is pure insanity. Fallback from that is rsync, which will do exactly what you want. Next down the list, using diff/patch. Next, using an ftp client that does smart diffing. Finally, in last place, manually copying over the files.

  6. Tim Connor says:

    Oh, and if you like the windows approach, which does have it’s niceties I’ll admit, how would you manage updating a bunch of files, adding some, and deleting others, in one step? That sort of thing is as frequent of a use case, almost.

  7. matthijs says:

    Ok, that’s a situation in which I can understand your annoyance. In a situation like that you could try a subversion system. Then updating, merging and possibly rolling back is very easy.

  8. Aleksandar says:

    Tim, you just gave me a homework. Investigate rsync 1st.

    Problem here is that I was updating an old client site, which runs mostly without me, for years. A rather small update and I managed to kill entire resource (icons, images) folder they gathered for months (years).
    One backup + 3 different discs dusted off + 4h wasted and we are mostly back in business.

    Deleting some would be problem in that case, Tim. I have no idea but manually or scripting.

  9. Tim Connor says:

    Yeah, it’s a painful lesson to learn and one could argue that the rsync approach of having to use a parameter to perform deletes (which could be holding a modifier key down in a gui drag/drop) is less surprising. In fact, now that I think of it, that is how it should work.

  10. Chris Hester says:

    I’m with the first commenter. However I try it, moving a folder with the same name just puts the folder inside the other folder. The second commenter is referring to copying files, not moving folders.

  11. ryan says:

    I definitely agree. I’ve used both for some time and what I’ve found is that I, at least, usually want to merge contents when copying a folder… My intention is rarely to replace the folder. It is to merge. Almost always.

    In my opinion the default behaviour should be to merge with a modifier key to replace. I would accept vice versa as well, but there you go.

  12. klokie says:

    Hi Aleksandar,
    I came across your post as I was just bitten by the same bug — I certainly wouldn’t call it a feature, having migrated to Mac from the Linux and Windows systems which have always supported recursive merges.

    I even tried 6 data recovery programs, and none of them could find any traces of the directory that had been replaced!

    What I would suggest to you, as I will do in the future, is either to use rsync (as another user has suggested) as I usually do for machine-to-machine copies or “cp –v –npR source/* destination/”, which should give you the recursive merge you might expect.

  13. Aleksandar says:

    Klokie, tnx. Nice one-liner.

Leave a Comment

Add your comment here, just please be civilized and stay on topic.