Implement dd nearing completion#2474
Conversation
- Prototype code. - Adds project boilerplate for integration with coreutils framework.
- Move code closer to real impl - Remove Makefile from repo
- implements basic copy & progress functionality - rough work for conversion tables - adds sanity tests (mt, zeros, ones, deadbeef & rand)
…le) tests for conversions
- Adds support for calling dd fn from cl - Adds basic cl tests from project root - Adds support for multiplier strings (c, w, b, kB, KB, KiB, ... EB, E, EiB.
- Moves all arg parsing & tests to parseargs.rs - Moves conversion tables to conversion_tables.rs - Adds ebcdic_lcase and _ucase tables - Refactors options: This **Breaks Write for Output**
- All conv flags now parsed (full functionality is TODO) - Changes functionality of eg. conv=ebcdic,ucase to match gnudd
- conv=sparse option requires knowledge of File/Stdout to change
behaviour.
- Unclear how best to impl this.
- Possible option: develop 4 versions of dd<X,Y> for each valid pair of { File, Stdin,
Stdout }.
- Adds duplicate dd fn :-( for differentiating between File backed and non-File outputs. - Implements cflag=sparse,fsync,fdatasync which were previously blocked. - Adds plumbing for IFlags & OFlags incl parsing. - Partial impl for seek=N and skip=N which were previously blocked.
- Completes impl of skip=N, and seek=N - Parses cbs=N
- Pushes file/stdout specific logic to trait objects. - Extracts read/write helper - Extracts conv/block/unblock helper - Impl block - WIP: Many failing tests!
- Unit tests split into individual folders - Parseargs test module renamed unit_tests to match new structure
- Move test macros to specific modules.
- Adds unit tests - Implements unblock - All tests passing
- Splits read fn into conv=sync and standard (consecutive) versions. - Fixes bug in previous read/fill where short reads would copy to wrong position in output buffer. - Fixes bug in unit tests. Empty source would pass (since no bytes failed to match).
- Adds tests where ibs causes extention - Impl conv=sync. All tests passing.
- Spoiler Alert: Turns out it was just the lcm.
- Adds print fn's - Modifies internal fn's as needed to track read/write state - Modifies status update thread to respect status level - Adds signal handler for SIGUSR1 (print xfer stats)
- Adds tests for count=READS and count=BYTES. - Implements count logic for read count and bytes count limits.
- Adds words to cspell exceptions - Converts test macros to use Default trait. - Converts parser to use Default trait. - Adds Windows-friendly test files for block/unblock when nl is present in test/spec file.
- Adds words to cspell exceptions - Converts test macros to use Default trait. - Converts parser to use Default trait. - Adds Windows-friendly test files for block/unblock when nl is present in test/spec file.
- Adds more jargon to the spellchecker jargon file. - Adds more ignores to the per-project ignores. - Fixes clippy warnigns about uneeded clones on non-linux. - Block/Unblock now account for system dependend newlines.
|
May I get the pending build actions approved? |
- cSpell valiantly vanquished - fmt issues addressed
|
I've addressed the block/unblock tests that fail on Windows... by ignoring them. I was working on a solution, but it was just big enough to feel like it should be a separate issue, so I've reverted my changes. Some questions came up as I was implementing this feature. If there are certain answers to them feel free to link or give them here. If there are no certain answers and a bit of discussion is required, then it would probably be best to have this discussion in the issue itself. Either way, I'll link this comment in the issue when it's created
|
|
Code coverage and clippy are failing on Windows. |
|
Agreed :-) Those issues should be addressed in the most recent push. |
|
Excellent! many thanks :) |
Back in the day, I opened #1861 indicating that I would work on dd. I thought it would be a month or so to complete it, but I was off by a small-ish margin ;-). Even though a few features are still missing, and some cleanup work remains, I am opening this pull request to bring dev work to the wider community, and basically stop hoarding the project.
Below is a list of todo items I am aware of.
Future work (to be created as separate issues)
[cio, nocache, nolinks, text, binary]are not implemented at all, and[direct, directory, dsync, sync, nonblock, noatime, noctty, nofollow]are only expected to work on Linux. Testing is also a little light on this one.dd_fileout(...)anddd_stdout(...)(ideally there should just be one function). Fixing this will require adjusting the way thatfsync()fdatasync()andwrite_all()are handled. The solution probably involves dynamic dispatch.--if foo.filefor free, andif=foo.fileshould continue to work), mention multiplier strings.I'd like to continue working on this project, and am happy for any suggestions.