bug-make
[Top][All Lists]
Advanced

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

Re: GNU make to consider files checksum


From: Giuseppe Scrivano
Subject: Re: GNU make to consider files checksum
Date: Sat, 12 Apr 2008 14:19:44 +0200

2008/4/12, Eli Zaretskii <address@hidden>:
> Thanks.  (I'm not the head maintainer, so please wait for Paul and
>  others to respond.)
>
>  > +int
>  > +compute_checksum(struct file *new)
>  > +{
>  > +  int checksum = 0;
>  > +  FILE *f;
>  > +  char buffer [4096];
>  > +
>  > +  f = fopen (new->name, "r");
>
>  This needs to use "rb", not "r".

Thank you for the reply, yes it should be "rb".


>  Also, what about directories? they cannot be fopen'ed and fread, at
>  least not on all supported systems.

IHMO directories should not be considered, while reading the mtime can
be done quickly, considering a checksum for all the files contained in
the directory is very expensive (in my proof-of-concept patch I didn't
put any control code).

Regards,
Giuseppe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]