[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: diff caches stuff in memory?



Hi,

* David Wright <d.wright@open.ac.uk> writes:

> Quoting Colin Marquardt (colin.marquardt@gmx.de):
>> apparently diff caches stuff in memory.

> I'm not sure what you mean by "made a new clean version".
> (I'm sure you know that -N means any empty files that were
> cleaned away will have no effect on diff's output.)

Okay, I haven´t been too understandable. Now I cannot reproduce it,
but the explanation what I did follows nevertheless.

Say, I want to do a diff against a directory that comes in a tarball
(xmms-0.9.5.1.tar.gz actually). I edit some files in a copy of that
directory (xmms-0.9.5.1_patch), then I diff against the original
directory (xmms-0.9.5.1, clean_dir in my previous example). 

I then realize that was I thought was the original wasn´t really the
directory as contained in the tarball because I did some
modifications there too. Now, to get a clean original directory
(xmms-0.9.5.1) I simply untar the tarball again (after deleting the
fake original directory), which gives me the same directory name as
before (xmms-0.9.5.1). Okay?

The original directory is now *really* original, i.e. *different* from
the former original (which was called xmms-0.9.5.1 as well), so I
should get also get a different diff output.

Now my second diff doesn´t recognize that the original directory has 
changed, it creates the same diff output as before.

> I didn't know diff bothered about timestamps, and I doubt kernel
> caching uses them either. (Of course, programs like tar and zip do.)

Okay, after some experiments I see that after untarring the original
directory anew, the timestamp on that directory is not the current
timestamp, but the timestamp at tar file creation. (tar xvzf
xmms-0.9.5.1.tar.gz)

> So, were I examining evidence, I'd be interested to know how you
> cleaned clean_dir, and I'd want to see a log showing diff getting
> the wrong answers (i.e. the diff output and two cats of affected
> files).

The test case I just set up worked! I don´t know what was
different... Maybe the error really was between keyboard and chair,
and I´ve now gotten the brown paper bag award :-(   I don´t know.

Thanks for taking the time to answer,
  Colin

-- 
| Re: Kernel size is 666K! I kid you not! 
| by Anonymous Coward on Tuesday January 26, @08:50AM 
| I came home from a Barry Manilow concert once and had 666 burned into
| my forehead! I shit you not!        [Kernel 2.2.0 is announced on /.]


Reply to: