tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Import truncate(1) from FreeBSD
> A few comments - just to the list, as I don't do @gmail for e-mail.
In my case, the effect is similar, but it's gmail's choice, not mine;
gmail outright rejects mail attempts from my infrastructure.
Apparently my setup isn't 31337 enough for them.
> | +server="rump_server -lrumpvfs -lrumpdev_disk -lrumpfs_ffs -d key=/dev/dk,hostpath=ffs.img,size=host"
> For this kind of long line, rather than wrapping it using a \ inside
> the "" it is cleaner to write it something like:
>
> server='rump_server -lrumpvfs -lrumpdev_disk -lrumpfs_ffs'
> server="${server} -d key=/dev/dk,hostpath=ffs.img,size=host"
Matter of opinion - I rather dislike that. And to then add
> (and yes, the use of '' in the first line is deliberate, when there
> are no expansions in the string, '' quoting is more efficient for sh,
when you're paying the penalty for expanding ${server} on the second
line...well, use a monetary analogy, I would call it penny-wise and
pound-foolish.
> | +.Cm K ,
> | +.Cm M ,
> | +.Cm G
> | +or
> | +.Cm T
> | +(either upper or lower case) to indicate a multiple of
> | +Kilobytes, Megabytes, Gigabytes or Terabytes
> | +respectively.
> Please make it clear whether this means MiB or MB (etc).
<rant>
I even more dislike that. As far as I can tell, the whole Mi, Ki, etc,
nonsense arose because disk makers felt like advertising fraudulently
large sizes and wanted to find whatever thin justification they could
for it and decided to tell people their established use of language was
somehow wrong. See the Jargon File entry for `quantifiers'.
What really bothers me is that the rest of the industry has let them
get away with it. (Well, most of it. RAM makers still use honest
sizes in my (limited) experience.) I think they really need to be
slapped with misleading-advertising charges; the Flyspeck 3 print
saying their sizes are based on the power-of-ten numbers is basically
admitting "yes, we're being deceptive, and yes, we're doing it
deliberately".
Whenever I import anything using the [KMGTPE]i idiocy, fixing it is one
of the first things I do.
</rant>
> | +If a file is made smaller, its extra data is lost.
> technically that should be "are lost"
I'm not sure. I think it's a defensible stance that `data' has
acquired a mass-noun meaning, for which a singular verb is appropriate.
I might even go so far as to say it has eclipsed the old count-noun
meaning; in my recent experience, applying a plural verb to `data' is
quite the rarity.
> | + if (do_dealloc == 1) {
> | + r = fdiscard(fd, off, len);
> | + }
> | + if (do_truncate == 1)
> | + r = ftruncate(fd, tsize);
> Mostly you're using the KNF "always use braces", but not everywhere.
> There the difference is particularly jarring.
Also, you've got (presumably-)boolean variables which you're comparing
with ==1 rather than !=0 (or the implicit !=0 of `if (var)'). Is there
any particuilar need for that? It looks...marked.
/~\ The ASCII Mouse
\ / Ribbon Campaign
X Against HTML mouse%rodents-montreal.org@localhost
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
Home |
Main Index |
Thread Index |
Old Index