Currently Being ModeratedMay 29, 2012 10:41 AM (in response to William @ Quebec)
The easist way to solve this is Shutdown the computer, with the drive still connected.
After shutdown, remove the drive from the mac, then startup.
After startup has finished, connect the drive to the computer (not the base station) and delete the files.
Currently Being ModeratedMay 29, 2012 10:59 AM (in response to softwater)
It worked?? Why?? I tried almost everything!! Thank you.. to simple though..
Currently Being ModeratedMay 29, 2012 11:05 AM (in response to William @ Quebec)
When programs open a file they put a filesystem lock on it to prevent other programs from editing the file at the same time. This is usually a quick lock so the file can be read into memory, and then the lock is released; however, there are times when a program needs to maintain a lock, or times when a bug might prevent the lock from being released. When this happens if you try to edit or delete the file the system will not allow it and will issue you the "in use" error. Fixing this requires quitting and relaunching of the application, but if you cannot figure out which application it is (or if it is a background service in OS X), then as softwater mentioned the easiest solution is to reboot the system. This will cause all processes in OS X to release their filesystem locks and re-initialize, and therefore clear the problem.
Currently Being ModeratedMay 29, 2012 11:10 AM (in response to William @ Quebec)
It wouldn't work before because some process was still running that was holding those file addresses in memory.
The easiest way to solve that is to keep the files connected and kill every process to release them from memory (which is what you did by doing 'Shutdown').
Of course, you can do it without shutting down if you know precisely which process(es) are causing the problem. Sometimes, that's as simple as quitting the last app that you used to read then, but other times, there are hidden processes going on that continue even when you quit the App's user interface.
Hence, a complete shutdown is often easier and always effective!
Currently Being ModeratedMay 29, 2012 11:27 AM (in response to Topher Kessler)
If by 'reboot' you mean 'restart', I'm not sure that will always work in Lion, given all the Resume, App Saved States, Reopen Windows etc processes. That's why I suggested 'shutdown' and remove the disk before booting up is a safer bet.
Currently Being ModeratedMay 29, 2012 11:41 AM (in response to softwater)
The "Resume" feature is separate from file locks. Resume just stores a document/window configuration for each program and will read this to restore the workflow as-is (using auto-saved files, etc.) when the program is next launched. The file lock issue happens below this, where any time an active program accesses a file (be it in an auto-resume configuration, a user-opened document, or otherwise) it will place a lock on it while the read/write process is happening, and then should release this lock if programmed properly.
Shutting down or restart/rebooting will do the same thing with regards to the file locks. Both processes will require all programs to quit and thereby release any current file locks they may have.
Currently Being ModeratedMay 29, 2012 11:56 AM (in response to Topher Kessler)
Ah, OK. I think I get it now. Thanks for taking the time to explain.
Currently Being ModeratedMay 29, 2012 1:01 PM (in response to softwater)
Wow, Thank you for the Info..
I don't understand why this would happen when connected to Apple base station though.
Currently Being ModeratedMay 29, 2012 2:55 PM (in response to William @ Quebec)
Nope not working, reconnected USB drive to Apple Base station problem still there...
Currently Being ModeratedMay 14, 2013 8:55 AM (in response to William @ Quebec)
Currently Being ModeratedMay 31, 2013 9:03 PM (in response to amitchauhan274)
This was an excellent fix. Thought I was back in a windows world with the other above answers, having to shutdown and reboot!
Currently Being ModeratedJun 1, 2013 5:56 AM (in response to amitchauhan274)
The only time to use the -r flag in that command is if you are deleting a folder with items in it. Otherwise leave this flag out as it will recurse through folders and remove all items within the targeted location. If for some reason you make a mistake in your syntax in targeting a single file, then you can inadvertently remove a large number of files if you include the -r flag.
Currently Being ModeratedJun 1, 2013 7:13 AM (in response to Topher Kessler)
Nice update. Thanks for the info as that is very handy to know.