06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

pHILE+ <strong>System</strong> <strong>Calls</strong> ftruncate_f<br />

ftruncate_f Changes the size of a file specified by its file identifier.<br />

#include <br />

unsigned long ftruncate_f(<br />

unsigned long fid, /* file identifier */<br />

unsigned long length /* file size in bytes */<br />

)<br />

Volume Types<br />

Description<br />

Arguments<br />

Return Value<br />

pHILE+, MS-DOS, and NFS formatted volumes.<br />

ftruncate_f() functions the same as truncate_f() except that<br />

ftruncate_f() changes the size of a file by using the file identifier instead of the<br />

pathname. The file identifier is first obtained with either open_f() or open_fn().<br />

Unlike annex_f(), this system call changes both the logical and the physical file<br />

size. (annex_f() changes only the physical file size.)<br />

On pHILE+ or MS-DOS volumes, the file must have been opened only once, that is<br />

no other task has it open and the calling task has opened it only once. If this is<br />

violated, the error E_FOPEN is returned.<br />

On pHILE+ or MS-DOS volumes, if the file is truncated shorter than its L_ptr, the<br />

L_ptr is changed to the new end-of-file.<br />

fid Specifies the file identifier associated with the file.<br />

length Specifies the new file size. If the file was previously longer than<br />

length, the extra bytes are truncated. If it was shorter, the bytes<br />

between the old and new lengths are filled with 0’s.<br />

This system call returns 0 on success or an error code on failure.<br />

<strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong> 2-43<br />

2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!