gfs_pio_truncate(3)

gfs_pio_truncate3

Truncate a file to a specified length

Usage

#include <gfarm/gfarm.h>

char *gfs_pio_truncate (GFS_File gf, file_offset_t length);

Overview

The gfs_pio_truncate() function truncates the regular file gf to the length bytes.

If the file was previously shorter than the length, it is extended, and the extended part is filled by zero bytes.

The file pointer is not changed.

You must specify GFS_FILE_MODE_WRITE in opening the file, because it must be open for writing.

Return values

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

Releases

Unchanged in 2 releases since Debian 6.0 (Squeeze).

  1. 6.0–7

From libgfarm-dev 2.4.1-1.1 in Debian 7 (Wheezy). Parsed by carta from the page's man source.