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

Re: diff caches stuff in memory?



Quoting Colin Marquardt (colin.marquardt@gmx.de):

> apparently diff caches stuff in memory.

That seems unlikely. I thought linux did that itself.

> I noticed that when I wanted to make a patch with
> 
>    diff -urN clean_dir patched_dir > my_patch
> 
> The patch came out fine, but then I realized that clean_dir wasn´t
> really clean, so I made a new clean version *with the same* directory
> name.
> 
> The second time I ran diff it went really fast. Too fast: it didn´t
> examine the files in clean_dir at all, it just used the data from
> the previous run which it had cached, so my patch was the same as
> before (wrong).

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.)

> How can I get diff to forget what it saw? The manpage doesn´t tell
> me. (I didn´t think about `touch'ing the directory then, but I
> untarred clean_dir from a tarball, so it should have gotten a newer
> time stamp).

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

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).

Cheers,

-- 
Email:  d.wright@open.ac.uk   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.


Reply to: