bug-findutils
[Top][All Lists]
Advanced

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

Re: Bug in find's -size (+patch)


From: amir
Subject: Re: Bug in find's -size (+patch)
Date: Mon, 7 Feb 2005 15:40:15 -0500 (EST)
User-agent: SquirrelMail/1.4.4

> -      if (f_val < pred_ptr->args.size.size)
> -     return (true);
> +      if (pred_ptr->args.size.blocksize > 1
> +       && (stat_buf->st_size % pred_ptr->args.size.blocksize != 0))
> +     return f_val <= pred_ptr->args.size.size; /* allow 1.5Mb file to match
> -size -2M */
> +      else
> +     return f_val < pred_ptr->args.size.size;
>        break;
Well, that would work, yes. Again, I find this a complete topsy-turvy
patch. You first break the file's real size by rounding up, and then make
up for it. But if that's the POSIX way, and you're not willing to
segregate POSIX's weird way of handling things of the GNU extensions, at
least that modification will give a correct result from the user's
standpoint.
 Regardless, just for discussion's sake, I think that whole rounding up
issue is because when this standard was written, the person who wrote it
probably assumed the administrator would be smart enough to account for
the fact that a block is completely taken, not half-taken, and thus a
1756 byte file would take up four blocks and really be 2kb - which is not
-2k. But this rounding up is completely irrelevant with the GNU
multipliers such as g and m, and should not be done. I'm just guessing,
though. It was a bit before my time.
 So, what's the verdict? :)

 -Amir







reply via email to

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