2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 ANSI C function truncate().
13 /*****************************************************************************
25 Truncate a file to a specified length
28 path - the path of the file being truncated
29 lenght - The file will have at most this size
32 0 on success or -1 on errorr.
35 If the file previously was larger than this size, the extra data
36 is lost. If the file previously was shorter, it is
37 unspecified whether the file is left unchanged or is
38 extended. In the latter case the extended part reads as
51 ******************************************************************************/
55 if (!path
) /* safety check */
61 if ((fd
= open(path
, O_WRONLY
)) != -1)
63 ret
= ftruncate(fd
, length
);