diff options
author | Richard Jones <rjones@redhat.com> | 2010-05-12 17:32:39 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-05-12 17:33:16 +0100 |
commit | 0c1e77219ea264a51b62e648003bfbea51db8ffb (patch) | |
tree | f374be51bf1a2e92fc8bf35c457ce6b1ff9efa67 /src | |
parent | 9d158c3ab132df21d58890f18224cd2fe020de67 (diff) | |
download | libguestfs-0c1e77219ea264a51b62e648003bfbea51db8ffb.tar.gz libguestfs-0c1e77219ea264a51b62e648003bfbea51db8ffb.tar.xz libguestfs-0c1e77219ea264a51b62e648003bfbea51db8ffb.zip |
New API: fill-pattern for creating files with predefined patterns.
Diffstat (limited to 'src')
-rw-r--r-- | src/MAX_PROC_NR | 2 | ||||
-rwxr-xr-x | src/generator.ml | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR index 7f05eede..2c2b1af8 100644 --- a/src/MAX_PROC_NR +++ b/src/MAX_PROC_NR @@ -1 +1 @@ -244 +245 diff --git a/src/generator.ml b/src/generator.ml index d2abafcb..31f0e027 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -4252,7 +4252,9 @@ content of the file is C<len> octets of C<c>, where C<c> must be a number in the range C<[0..255]>. To fill a file with zero bytes (sparsely), it is -much more efficient to use C<guestfs_truncate_size>."); +much more efficient to use C<guestfs_truncate_size>. +To create a file with a pattern of repeating bytes +use C<guestfs_fill_pattern>."); ("available", (RErr, [StringList "groups"]), 216, [], [InitNone, Always, TestRun [["available"; ""]]], @@ -4612,6 +4614,17 @@ filename is not printable, coreutils uses a special backslash syntax. For more information, see the GNU coreutils info file."); + ("fill_pattern", (RErr, [String "pattern"; Int "len"; Pathname "path"]), 245, [], + [InitBasicFS, Always, TestOutputBuffer ( + [["fill_pattern"; "abcdefghijklmnopqrstuvwxyz"; "28"; "/test"]; + ["read_file"; "/test"]], "abcdefghijklmnopqrstuvwxyzab")], + "fill a file with a repeating pattern of bytes", + "\ +This function is like C<guestfs_fill> except that it creates +a new file of length C<len> containing the repeating pattern +of bytes in C<pattern>. The pattern is truncated if necessary +to ensure the length of the file is exactly C<len> bytes."); + ] let all_functions = non_daemon_functions @ daemon_functions |