uutils/coreutils — pull request #182 by zvms (2014-05-20 01:21:14+00:00)
Title: Add dd command

**DO NOT MERGE**
**THIS IS INCOMPLETE AND JUST HERE FOR COMMENTS**

This is an initial attempt at implementing dd. It is very incomplete but working.

Progress:

* [ ] Option Parsing
* [x] bytes
* [x] uints
* [x] paths
* [ ] flags
* [ ] tests for all the above
* [x] basic operations
* [x] stdin input
* [x] file input
* [x] stdout output
* [x] file output
* [x] count
* [ ] skip
* [ ] seek
* [ ] correctly handle ibs/obs
* [ ] converting
* [ ] cbs opt
* [ ] conv opt
* [ ] oflag
* [ ] iflag

Performance:

This is in no way a scientific benchmark and performance may change as it becomes feature complete. This benchmark means absolutely nothing other than "there's no major bottlenecks right now".
~~~
./build/dd if=/dev/zero of=/dev/null bs=1024 count=10240
10240+0 records in
10240+0 records out
10485760 (10.48576 MB) bytes copied, 0.084566 s, 123.994494 MB/s

dd if=/dev/zero of=/dev/null bs=1024 count=10240
10240+0 records in
10240+0 records out
10485760 bytes (10 MB) copied, 0.0840395 s, 125 MB/s

---

./build/dd if=/dev/zero of=/dev/null bs=1024 count=102400
102400+0 records in
102400+0 records out
104857600 (104.8576 MB) bytes copied, 0.737123 s, 142.252565 MB/s

dd if=/dev/zero of=/dev/null bs=1024 count=102400
102400+0 records in
102400+0 records out
104857600 bytes (105 MB) copied, 0.745447 s, 141 MB/s

---

./build/dd if=/dev/zero of=/dev/null bs=102400 count=1024000
1024000+0 records in
1024000+0 records out
104857600000 (104.8576 GB) bytes copied, 11.484665 s, 9.130227 GB/s

dd if=/dev/zero of=/dev/null bs=102400 count=1024000
1024000+0 records in
1024000+0 records out
104857600000 bytes (105 GB) copied, 11.1977 s, 9.4 GB/s
~~~