Hello. I'm Aleksandar Vacić, professional web developer and wine maker in the making.
Learn more about me or see what I can do for you.

My work & services

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.

tags: Apple
Comments: 13

Posted 2 years, 8 months agopermanent link

trackback URL: http://aplus.rs/apple/the-most-idiotic-design-decision-in-unixmac-os-x/trackback/

Voices from the crowd, 13 so far

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.

by John P
5 hours, 15 minutes after the post

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?

by matthijs
9 hours, 51 minutes after the post

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.

by Aleksandar
10 hours, 51 minutes after the post

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”?

by Aleksandar
10 hours, 57 minutes after the post

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.

by Tim Connor
17 hours, 9 minutes after the post

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.

by Tim Connor
17 hours, 10 minutes after the post

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.

by matthijs
19 hours, 43 minutes after the post

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.

by Aleksandar
23 hours, 22 minutes after the post

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.

by Tim Connor
1 day, 1 hour after the post

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.

by Chris Hester
1 day, 10 hours after the post

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.

by ryan
2 weeks, 6 days after the post

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.

by klokie
1 month, 1 week after the post

Klokie, tnx. Nice one-liner.

by Aleksandar
1 month, 1 week after the post

Post your opinion


? You need to enter your email, but rest assured it will not be published.

? Enter the link and it will be published.
? This blog strives to behave properly, as per XHTML 1.0 Strict spec. You can use the following tags, but please use them wisely:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
? I have enabled comment moderation so if your comment does not shows up after you submit it, don't worry. I will review it and if it's nice and to the point, I'll approve it. This measure is up mostly to fight spam and trolls.

Tags or categories or topics...

Lots of ramblings on this blog...might be easier for you to find your juice through these tags:

Post a job. Find one. authenticjobs.com