Chapter Contents

Previous

Next
truncate

truncate



Truncate an HFS File

Portability: UNIX compatible


SYNOPSIS
DESCRIPTION
RETURN VALUE
USAGE NOTES
RELATED FUNCTIONS


SYNOPSIS

#include <unistd.h>
int truncate(const char *pathname, 
             off_t length);


DESCRIPTION

truncate truncates or extends an UNIX System Services file. pathname specifies the name of the file. length specifies the size of the file. If the length is greater than the current file size, zero bytes are added to the file at the end.

For programs not compiled with the posix option, a style prefix may be required as part of the pathname . See "File Naming Conventions" in the SAS/C Library Reference, Volume 1, for further information.


RETURN VALUE

truncate returns 0 if successful, or -1 if unsuccessful.


USAGE NOTES

The truncate function can only be used with MVS 5.2.2 or a later release.


RELATED FUNCTIONS

ftruncate


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.