From 90cf7fc904fca42665fe04cdd90a4c547d23b00c Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 2 Nov 2009 17:02:32 +0000 Subject: New API call: pread guestfs_pread lets you do partial file reads from arbitrary places within a file. It works like the pread(2) system call. --- src/MAX_PROC_NR | 2 +- src/generator.ml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR index b35cfafd..c92ba568 100644 --- a/src/MAX_PROC_NR +++ b/src/MAX_PROC_NR @@ -1 +1 @@ -206 +207 diff --git a/src/generator.ml b/src/generator.ml index 001d0217..bbdb3308 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -3856,6 +3856,17 @@ message size to be exceeded, causing this call to fail. The caller must split up such requests into smaller groups of names."); + ("pread", (RBufferOut "content", [Pathname "path"; Int "count"; Int64 "offset"]), 207, [ProtocolLimitWarning], + [InitISOFS, Always, TestOutputBuffer ( + [["pread"; "/known-4"; "1"; "3"]], "\n")], + "read part of a file", + "\ +This command lets you read part of a file. It reads C +bytes of the file, starting at C, from file C. + +This may read fewer bytes than requested. For further details +see the L system call."); + ] let all_functions = non_daemon_functions @ daemon_functions -- cgit