diff options
author | Roman Rybalko <devel@romanr.info> | 2012-02-27 13:53:07 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2012-02-29 00:17:56 +0000 |
commit | 4e776faa8482ae630d2ea9bc767298e664f07ba9 (patch) | |
tree | 22c337b9f4986e7448ab952d1999d6ee5ca3cff6 /doc | |
parent | 697d00c321ed1a9610974f375e6146cb025f5198 (diff) | |
download | coreutils-4e776faa8482ae630d2ea9bc767298e664f07ba9.tar.xz |
dd: add support for the conv=sparse option
Notes:
Small seeks are not coalesced to larger ones,
like is done in cache_round() for example.
conv= is used rather then oflag= for FreeBSD compatibility.
* src/dd.c (final_op_was_seek): A new global boolean to flag
whether the final "write" was converted to a seek.
(usage): Describe the new conf=sparse option.
(iwrite): Convert a write of a NUL block to a seek if requested.
(do_copy): Initialize the output buffer to have a sentinel,
to allow for efficient testing for NUL output blocks.
If the last block in the file was converted to a seek,
then convert back to a write so the size is updated.
* NEWS: Mention the new feature.
* tests/dd/sparse: A new test for the feature.
* tests/Makefile.am: Reference the new test.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/coreutils.texi | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 414626dc5..0d252fcda 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -8140,6 +8140,17 @@ Change lowercase letters to uppercase. The @samp{lcase} and @samp{ucase} conversions are mutually exclusive. +@item sparse +@opindex sparse +Try to seek rather than write @sc{nul} output blocks. +On a file system that supports sparse files, this will create +sparse output when extending the output file. +Be careful when using this option in conjunction with +@samp{conv=notrunc} or @samp{oflag=append}. +With @samp{conv=notrunc}, existing data in the output +corresponding to @sc{nul} blocks from the input, will be untouched. +With @samp{oflag=append} the seeks performed will be ineffective. + @item swab @opindex swab @r{(byte-swapping)} @cindex byte-swapping |