pwrite


Description:

[ Version ( since = "1.3.14" ) ]
public int32 pwrite (string path, uint8[] content, int64 offset) throws Error

write to part of a file

This command writes to part of a file. It writes the data buffer content to the file path starting at offset offset.

This command implements the pwrite(2) 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 pread, pwrite_device.

Parameters:

this

A GuestfsSession object

content

an array of binary data

content_size

The size of content, in bytes

Returns:

the returned value, or -1 on error