Technical Discussion
  >> Apple Issues


Register (or login) on our website and you will not see this ad.


Pages in this thread: 1 | 2 | (show all)   Print Thread
Standard User billford
(elder) Sat 28-Sep-13 14:37:25
Print Post

File in use


[link to this post]
 
I had a problem this morning being unable to delete a file (on a NAS drive) because Finder said it was in use... rm gave the same error, as did trying to eject the drive to force it out of use (when in doubt, get a bigger hammer tongue).

It shouldn't have been in use... I sorted it out eventually by rebooting the iMac, but it's a bit brutal. How can you find out which process Finder thinks a file is being used by? (I assume looking the PID up in Activity Monitor will give the application)

And if that gives no useful result (ie OS X has got it wrong) is there any reasonably safe way to delete a file regardless of its "in use" status?

Bill
A level playing field is level in both directions.

__________Fold at Home_________________Planes and Boats and ... ______________BQMs: IPv4 IPv6
Standard User bet_here
(regular) Sat 28-Sep-13 15:02:44
Print Post

Re: File in use


[re: billford] [link to this post]
 
lsof | grep myfile.ext

perhaps?

Simon
Standard User billford
(elder) Sat 28-Sep-13 15:19:18
Print Post

Re: File in use


[re: bet_here] [link to this post]
 
That works, thanks smile

Now I need a way to delete it even if Finder says it's in use and that command says it isn't... but I'll have to wait until it occurs again to see if that's what happened this morning.

(I suspect it will happen again- it's sort of happened before, but on those occasions I just had to wait ten minutes or so and whatever was using it released it. This time it didn't.)

Bill
A level playing field is level in both directions.

__________Fold at Home_________________Planes and Boats and ... ______________BQMs: IPv4 IPv6


Register (or login) on our website and you will not see this ad.

Standard User bet_here
(regular) Mon 30-Sep-13 09:12:53
Print Post

Re: File in use


[re: billford] [link to this post]
 
The only time I've seen anything like this is when emptying the trash - in which case I just use 'Secure Empty' which sorts it.

Simon
Standard User billford
(elder) Mon 30-Sep-13 09:56:33
Print Post

Re: File in use


[re: bet_here] [link to this post]
 
I've had similar effects on occasion with trashed files on internal or attached (USB) drives, but this NAS (it's actually a USB HDD connected to an Asus router) doesn't have a trash... whether that's a limitation of the router, OS X, or that it's FAT32 I've no idea but when it works deletion is immediate and permanent.

Bill
A level playing field is level in both directions.

__________Fold at Home_________________Planes and Boats and ... ______________BQMs: IPv4 IPv6
Standard User TheHorseman
(knowledge is power) Mon 30-Sep-13 13:24:29
Print Post

Re: File in use


[re: billford] [link to this post]
 
Did you try rm -f or just rm?

BT -> Zen -> F2S -> Bulldog -> Be* -> BT Infinity 2
Say it with flowers, give her a Triffid smile
Standard User billford
(elder) Mon 30-Sep-13 14:55:05
Print Post

Re: File in use


[re: TheHorseman] [link to this post]
 
Just rm iirc.

man rm says:
The rm utility attempts to remove the non-directory type files specified on the command line. If the permissions of the file do not permit writing, and the standard input device is a terminal, the user is prompted (on the standard error output) for confirmation.

It didn't get as far as asking for confirmation, just gave the error- "Cannot delete, file is in use" (or words to that effect).

Bill
A level playing field is level in both directions.

__________Fold at Home_________________Planes and Boats and ... ______________BQMs: IPv4 IPv6
Standard User stniuk
(experienced) Mon 30-Sep-13 15:02:38
Print Post

Re: File in use


[re: billford] [link to this post]
 
Usually a restart fixes it, it probably 'forgets' about the file after the restart.
Standard User billford
(elder) Mon 30-Sep-13 15:34:57
Print Post

Re: File in use


[re: stniuk] [link to this post]
 
When all else fails, re-boot wink

That's what I did in the end, but it was inconvenient- I had to wait a day or so for something else to finish.

Bill
A level playing field is level in both directions.

__________Fold at Home_________________Planes and Boats and ... ______________BQMs: IPv4 IPv6
Standard User time2die
(eat-sleep-adslguide) Mon 30-Sep-13 15:42:55
Print Post

Re: File in use


[re: billford] [link to this post]
 
No good asking me wink i struggled for 30 minutes trying to figure out where the Power on button was on the Imac when i first had it.blush
Pages in this thread: 1 | 2 | (show all)   Print Thread

Jump to