Set the size of the file referred to by descriptor to size.
Declared in <bdls_filesystemutil.h>
static
int
truncateFileSize(
FileDescriptor descriptor,
Offset size);
Set the size of the file referred to by the specified descriptor to the specified size. descriptor must be open for writing. After the function call, the position is set to the end of the file. Return 0 on success and a non-zero value otherwise. The behavior is undefined if the file is currently mapped, or if size is greater than the existing size of the file.
0 on success, and a non-zero value otherwise
| Name | Description |
|---|---|
| descriptor | file descriptor of the file to resize |
| size | new size of the file, in bytes |