It’s the little things…

So this post isn’t going to focus on huge changes, sometimes its the little things that count. Specifically, the way that Mac OS handles files and folders that are in-use.

This can be a area of pain for Windows users, who hasn’t seen the error message below and despaired at how to find the file that is in use by either guessing/checking every open command prompt or using a tool like Handle or FileMon.

Access Denied

Note: Much of the pain caused by this message could be avoided if the in-use file/folder information was included on this message. I probably wouldn’t be writing this post if it was.

To say Mac OS X handles this in a better way would be an understatement of colossal magnitude (Ok, Ok, maybe that is overstating it but I really hated this under Windows :).

Take this situation:

Rename1

I have a folder, with a file in it. The folder is open in a finder window and a terminal window, the file is also open in preview. Recipe for disaster, right? :)

Rename2

Rename the file and the file updates in the finder, so far so good but Windows also does this. Click on the preview window though and the title bar updates… kinda neat but not earth shattering :)

Rename3

Now rename the folder and everything just works again. The open Finder window just updates, the preview updates. Very neat but still, we haven’t really improved on Windows yet. In Windows the folder would have closed instead of updating, but it’s a small victory :)

It is the next step where it gets interesting though:

Rename4

I removed the folder from the finder window and two things happened:

  • There was no 10 second pause, followed by the error.
  • The terminal window actually switched to follow the folder into the trash.

I could have also renamed the folder with the Finder window and the terminal window would just have updated next time I used it. The whole process “just works™”, it is so elegant it hurts.

Now this isn’t going to be a massive pain when all three windows are positioned right next to each other and visible like they are in this example, but how often does that happen in real life :) The terminal or command prompt is usually 16 windows deep or some rogue app has left open file handles to something and you end up in a reboot as the quickest way to fix it. It just wouldn’t happen here.

Like I said, it’s the small things :)

But… It isn’t completely rosy, I have a criticism that I found while writing this up, and while it is only a small point it is quite significant. Files removed with command line “rm” don’t get moved to the Trash. This is quite inconsistent and I am guilty of relying on the Trash/Recycle Bin too much sometimes :)

Update: I always thought that Windows honoured the Recycle Bin from command prompt but I just tested it and it doesn’t. Who knew!

Technorati Tags: , , , ,

27 responses to “It’s the little things…

  1. Ahhh…thats the hardest part of trying to explain what makes OS X so much different than Windows to people have never used it. You explain, and try to make them understand, but its only in using it for yourself and learning it that all those little things start to add up.

    Personally my greatest “little thing” is how if an app gets an error or has a dialog box in windows, it pops straight up to the front and interrupts whatever your doing until you have to deal with it, in OS X, the OS stays out of your way.

    But damn you have a good blog! Very insightful and you bring up ALOT of in depth perspective even though you are a relative “macnewbie”.

  2. If files deleted with ‘rm’ were moved to the trash, you’d hear the sound of hundreds of thousands of UNIX-focussed Mac users crying into their coffee. There’s actually no real ‘solution’ to the disparity besides education: you can’t change the semantics of ‘rm’ without causing a world of pain, unfortunately :)

  3. The reason “rm” doesn’t move to the trash is because it is a delete command not a move command. If you would like to move something into the trash then you would need to use the “mv” command. I don’t see an issue with inconsistency because the GUI is consistent with Mac OS conventions while the CLI is consistent with BSD conventions.

    Anyway the file behavior for moving and renaming is something we have enjoyed forever (or at least since I started using Macs back in the System 7.6.1 days). The way it was explained to me is that basically Mac OS doesn’t reference files by path or name instead it uses a temporary alias for each open file. The concept is the same as a pointer in C pretty much.

  4. You can also move an application to another folder whilst it’s still running!

  5. You are absolutely right Mo about it being all about education. Now I know (and luckily I found out without losing important files, just that Apple jpg :) and thats the end of the confusion.

  6. @Kroc: Wow, I hadn’t tried that. I am sure its the same OS functionality that allows it but thats an even better example (wish I could have used that instead of my example :)

  7. I just tested the ‘rm’/’del’ thing under windows and it doesn’t move it to the Recycle bin on Windows either. I never realised.

  8. You actually get a very similar message in Mac OS X (to the windows one you showed) when you try to eject a disk that has an open file on it. There’s no real clue as to what application has the file open – although it’s usually pretty obvious. Some room for improvement, Apple.

    Having just been forced to NOT use my Mac laptop at work, and instead use a work supplied Windows XP box, I’m really missing the ‘little things’ right now ! I believe it’s genuinely these little differences that really make the biggest difference to the user experience. For instance, I’m really missing the Mac’s system-wide spell-checking-as-you-type feature, so excuse any typos !

    If you’re a Terminal kinda person, you’ll really appreciate (or miss, if you’ve be forced to move TO windows) the extra key on the Mac keyboard ! What do I mean ? Well, I’m referring to the Command (‘apple’) key. It means you can use the same old cut-n-paste keyboard shortcuts in Terminal as in the rest of the OS. You might not even realise how nice this is until you try and use Windows, which uses ctrl-c and ctrl-p for these functions. But – as I’m sure you know – ctrl-c is NOT something you’d want to hit in a terminal window most of the time (it has a totally different meaning here; it breaks the execution of the currently running command).

    I’ve already lost count of the number of times that I’ve meant to copy something out of my MySQL session window, and ended up killing the process instead :-( ARGH !

    I used to look forward to coming in to work, with my efficient Mac-based workflow. Now, I look forward to going home. I feel like someone’s tied on hand behind my back and put a blindfold on me – THAT is the difference between Mac OS X and Windows

  9. Mark Kalderon

    If you find the difference between rm and moving to the trash confusing, try out the Born Again Remove Function by Gary Kerbaugh.

    http://www.cs.ecu.edu/~collins/rm/rm.html

  10. Another ‘little thing’ that drives me up the wall with windows – menus.

    If you’re a longtime Windows user, you’re probably well trained to stay exactly on the right line of the menu as you mouse across to a submenu – years of Start menu practise here helps. Because, if you stray just a little as you try to reach that sub menu, the whole thing disappears. You have to move exactly ACROSS and then DOWN to the item you want.

    On a Mac, you can ‘cut the corner’ – you can mouse directly to the item you want in a submenu, without having to go precicely across and down. There is an imperceptible delay before a submenu vanishes – but long enough for you to jump the mouse over to it.

    If you’re a long time windows users you might not even notice the difference, because you’re used to the finicky way Windows handles menus. But if you’re a Mac user, trying to use windows it’s INCREDIBLY BLOODY FRUSTRATING !!!!!!

  11. @ Andy – Ah ha! THAT’S why I find Windows menus so hard to traverse. I’ve encountered the problem using VPC, but have never stayed in Windows long enough to pinpoint the problem.

  12. Rather than installing a different, non-standard, version of ‘rm’, you could alias something like ‘del’ to a ‘mv’ command that would move the file to your trash bin (probably something like ‘mv “!*” ~/.Trash’). That’s the beauty of the shell, you can either make rm do pretty much anything you want it to do, or you can create your own dommand to do exactly what you want.

  13. Hello,

    Not to be a windows supporter but I just wanted to clarify that you can ‘cut the corner’ in windows. I was just using the start menu on windows XP SP2 and you can mouse directly to the item you want without having to precisely move the mouse across and down. This is also allowed in firefox.

    But I think this is on a program by program basis, which I do agree, is frustrating. Fortunately, you can ‘cut the corner’ in firefox. :)

  14. Nope – Firefox was actually the app I was using to confirm this behaviour (because it’s the one I was using at the time). I definitely cannot ‘cut the corner’ here : Windows XP Pro SP2.

    Now, I do remember hearing that this could be a hidden setting or some kind of extras pack, but c’mon ! this should be in there from the get-go.

    Anyway, good to see there is a way of fixing it. 1 down, 999,999 other annoyances to go :)

  15. FYI, Unlocker does just that for Windows: http://ccollomb.free.fr/unlocker/

    It’s one of those “must-install” addons :)

  16. Not to be a Windows Supporter here (mac user myself); but in the computer i’m using right now (College Lab) I can “cut the corner”. I tried in the ‘start’ menu and in Internet Explorer (i know, i know! …this isn’t my computer). So maybe it’s your computer that doen’t allow this; or this is a setting that can be arranged.

  17. With Win2k (at least with Firefox on Win2k), the “cut the corner” appears to be more of a time-delay thing . . . rather than a true UI-interaction thing. That is to say, you CAN cut the corner as long as you’re fast about it.

    My Mac is at home, so I can’t say exactly if the “cut the corner” is time-delay-based or strictly pointer-position-based.

  18. @Christian: Absolutely, I would never replace rm :) The addition of a del command is a good idea though

  19. Windows menus are smaller and harder to hit anyways (serious Fitt’s Law problems) so they naturally increase the blood pressure just using them. Then there’s keyboard accelerators and keyboard shortcuts — being a UI designer meant that I had to put both in there! It was no end of semantic confusion and total pointlessness. The Mac does it right and keeps it simple. Menus and keyboard shortcuts — that’s it.

  20. On XP, you can use the Powertools TweakUI to adjust the menu speed. This is cleverly hidden under the Mouse section.

    Unfortunately, this controls both the speed that the menu appears AND disappears. I want the menus to appear right away, but not disappear when my mouse slips off by a single pixel. So you can have glacial menus, or twitchy ones.

    It’s also not a universal setting…I just tried it in Firefox’s bookmarks, and they are as twitchy as ever.

  21. blagermeister

    I’d second Christian’s comment. Using aliases in your shell profile is a powerful way of making custom commands, assuming you even need to work in the shell. One big reason why you don’t want to change core files is that Apple will likely overwrite them in an update. Not to mention the immediacy of changes in the shell.

  22. I discovered another nifty file-handling thing tonight. I was downloading a rather large file, which i just dropped in my Documents folder b/c I didn’t have the file structure set up to handle it yet. I went and created the structure while it was downloading and without thinking dropped the file into the right place. The download just kept on humming without a complaing.

  23. @brock: Thats cool :)

  24. “always thought that Windows honoured the Recycle Bin from command prompt but I just tested it and it doesn’t. Who knew!”
    In both cases, the use of command line instructions (CLI), is not intended for non technical users. Technical users *usually* know what they are doing.
    You are right, it is about the little things. That’s why people love OS-X so much. I’m using Ubuntu Dapper.

  25. One question – why should you rename a file that is opened by an application? I’ve never even seen that Windows error message, simply because it makes no sense deleting, moving or renaming files that are in use.

  26. If you’ve never seen that message, you are extremely lucky. There are many reasons why one would want to rename or move a file that is in use. Why should the OS get in your way and force you to close the app first? Why on earth can’t it at least tell you what app has it open?

  27. i’ve never explored cmd with that yet. well, it’s kind of annoying to see error messages popping up like a hijacker in windows.