[mythtv-users] incomplete Deletes on a shared SMB directory

Chris Pinkham cpinkham at bc2va.org
Fri Dec 1 20:45:05 UTC 2006

* On Fri Dec 01, 2006 at 07:48:21AM -0800, Yeechang Lee wrote:
> Jerome Yuzyk <jerome at supernet.ab.ca> says:
> > From the half-dozen fragments I haven't got around to deleting manually, it 
> > looks like the last 4M fragment is missed: all my fragments are less than 
> > 4M.
> The sizes of the fragments tell me that this almost certainly is
> another manifestation of the stub issue I reported. As I've noted,
> however, my particular workaround won't work.

This is a total hack and shouldn't be required, but you could try adding
a call to unlink after the close() in MainServer::TruncateAndClose().

Look in mainserver.cpp and search for the following line at the bottom
of the TruncateAndClose() method.

	bool ok = (0 == close(fd));

Add a couple lines right after that like this:

	bool ok = (0 == close(fd));

	if (ok)
	    ok = (0 == unlink(filename));

It could be that a broken SMB implementation is keeping the file around
even though we deleted it because of the fact that we continued to
access the file by truncating it.  This will forcibly delete the file
after we've truncated it down as far as we wanted.


More information about the mythtv-users mailing list