X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=src%2Fgenerator.ml;h=32a814003a3247d16be83e4bd69b085df57feec1;hp=dfab8dcd4e9cbb5fb290fe28984a4131cc03cf03;hb=1214b321621e7750c67423ecf4d9528809e1eeac;hpb=3920ad95f6b2db8fbf20aa26692877a09070cb04 diff --git a/src/generator.ml b/src/generator.ml index dfab8dc..32a8140 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -4062,7 +4062,9 @@ 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."); +see the L system call. + +See also C."); ("part_init", (RErr, [Device "device"; String "parttype"]), 208, [], [InitEmpty, Always, TestRun ( @@ -4658,6 +4660,32 @@ to ensure the length of the file is exactly C bytes."); This call creates a file called C. The content of the file is the string C (which can contain any 8 bit data)."); + ("pwrite", (RInt "nbytes", [Pathname "path"; BufferIn "content"; Int64 "offset"]), 247, [ProtocolLimitWarning], + [InitBasicFS, Always, TestOutput ( + [["write"; "/new"; "new file contents"]; + ["pwrite"; "/new"; "data"; "4"]; + ["cat"; "/new"]], "new data contents"); + InitBasicFS, Always, TestOutput ( + [["write"; "/new"; "new file contents"]; + ["pwrite"; "/new"; "is extended"; "9"]; + ["cat"; "/new"]], "new file is extended"); + InitBasicFS, Always, TestOutput ( + [["write"; "/new"; "new file contents"]; + ["pwrite"; "/new"; ""; "4"]; + ["cat"; "/new"]], "new file contents")], + "write to part of a file", + "\ +This command writes to part of a file. It writes the data +buffer C to the file C starting at offset C. + +This command implements the L system call, and like +that system call it may not write the full data requested. The +return value is the number of bytes that were actually written +to the file. This could even be 0, although short writes are +unlikely for regular files in ordinary circumstances. + +See also C."); + ] let all_functions = non_daemon_functions @ daemon_functions