strange behavior of 'rm'

James Cameron quozl at laptop.org
Sun Aug 15 19:51:27 EDT 2010


On Sun, Aug 15, 2010 at 05:46:21PM +0200, Tomeu Vizoso wrote:
> Some git grep turned out this:
> 
>     def _write_favorites_file(self):
> 
> I know this seems counter-intuitive to lots of engineers, but reading
> code actually ends up saving time.

Thanks.

At the time, I wasn't interested in where in Sugar the file was written
or under what circumstances, I was only interested in whether I could
reproduce the problem that Mikus reported.

I don't see how your locating the code, Tomeu, has led to any greater
understanding of the problem that Mikus reported, since you did not
describe the frequency of the method execution.

I'm talking about the problem of the file not being deleted by rm yet
with the absence of Sugar restarts.

On Sun, Aug 15, 2010 at 01:19:00PM -0500, Mikus Grinbergs wrote:
> Since nobody is paying me for my time - and with me wondering WHERE
> the output of such a 'simplejson.dump()' function is being used (and
> WHAT can happen if the result contains multiple entries with the same
> bundle-name) - spending time by reading the quoted code does not
> appeal.

I agree.  I'm not convinced reading the code would be useful at this
stage.  I'm more puzzled at why repeated rm commands with a 'y' answer
don't work for you.

I'd like to get to the bottom of that if you're willing, but I know you
don't always like diagnosing problems.

The suggestion that language differences are a cause of not deleting a
file can be eliminated by testing with strace.  The recognition of the
"y" for confirmation is done by the rm program, not the kernel.  strace
allows us to capture the interaction between rm and the kernel:

	strace -o rm.strace  rm -i favorite_activities

If the output file rm.strace contains:

	unlinkat(AT_FDCWD, "favorite_activities", 0) = 0

then it means that the kernel was asked to delete the file, and so
language differences can be excluded.  If there is no such line, then
the kernel was probably not asked to delete the file.

> What started this whole pilgrimage was Quozl noticing (I believe in
> shell.log in one of my system dumps regarding a Record problem) a
> reference to an OBSOLETE version of Record.

Oh yes, I remember that.  It was puzzling, but I didn't feel it was
worth reporting to Sugar Labs, since it had no effect on the Sugar user.
Have you reported it in a ticket yet?

-- 
James Cameron
http://quozl.linux.org.au/


More information about the Devel mailing list