Removing a "busy" text file?

James Wilkinson james at westexe.demon.co.uk
Mon Jan 31 18:59:09 UTC 2005


Richard S. Crawford wrote:
> richard at seamus: ~/music/Howard Shore
> $ rm -rf THELO~1H/
> rm: cannot remove `THELO~1H//Concerning Hobbits.mp3': Text file busy

Turns out that this is on a Samba drive.

For what it's worth, I believe that this is significant. Unix natively
is quite happy to let you unlink (= remove from the file tree) an open
file: a number of programs explicitly use this to ensure that their
temporary files go away when they finish. [1]

SMB  / CIFS, coming from the DOS / OS/2 / Windows world, doesn't have
this concept. When a file is open, it's kept busy, and you can't delete
it.

It looks like Linux and rm understand this concept for SMB shares. It's
the approach that causes the fewest problems, but it is still not pure
Unix.

James. 

[1] Create a temporary file, immediately unlink it, and then keep using
it. Doesn't matter whether the program crashes or the power is pulled:
when the program finishes, the file is gone.

-- 
James Wilkinson       | Really, *really* bad headlines:
Exeter    Devon    UK | Drunks Get Nine Months in Violin Case
E-mail address: james | Iraqi Head Seeks Arms
@westexe.demon.co.uk  | British Left Waffles on Falkland Islands




More information about the fedora-list mailing list