2 ms·
But who cares? Why not just let the command figure out the right buffer size automatically? Because it can be a lot slower. dd is low level, hence powerful and
by tambourine_man 10y ago
But who cares? Why not just let the command figure out the right buffer size automatically?
Because it can be a lot slower. dd is low level, hence powerful and dangerous.
And, if we are going down that rabbit hole, you don't need cat[1]
“The purpose of cat is to concatenate (or "catenate") files. If it's only one file, concatenating it with nothing at all is a waste of time, and costs you a process.”
[1]http://porkmail.org/era/unix/award.html#cat http://porkmail.org/era/unix/award.html#cat
- schoen 10y agoBut if you don't use any process, what process is doing the reading? (This sounds like a zen koan somehow.)
- dredmorbius 10y agoI like the koan. But the point should be an additional process. In a UUOC avoidance case, it's the current process which reads, generally via stdin. Say, the shell, or dd itself with an 'if=' parameter. Which I strongly suspect you know.
- schoen 10y agoYep, my thought was that the UUOC critique doesn't apply to most attempts to substitute cat for dd, because typically those are copying from one (regular or special) to another, and you can't simply use redirection to accomplish this in the absence of a reader.
- smacktoward 10y agoWhen the file is ready, the process appears? :-D