Backport and version tag
[AROS.git] / rom / dos / setfilesize.c
blob929888ff805170d60241ad012105e3c7a00fac5d
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Change the size of a file.
6 Lang: english
7 */
8 #include <proto/exec.h>
9 #include <dos/dosextens.h>
10 #include "dos_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/dos.h>
17 AROS_LH3(LONG, SetFileSize,
19 /* SYNOPSIS */
20 AROS_LHA(BPTR, file, D1),
21 AROS_LHA(LONG, offset, D2),
22 AROS_LHA(LONG, mode, D3),
24 /* LOCATION */
25 struct DosLibrary *, DOSBase, 76, Dos)
27 /* FUNCTION
28 Change the size of a file.
30 INPUTS
31 file - filehandle
32 offset - relative size
33 mode - OFFSET_BEGINNING, OFFSET_CURRENT or OFFSET_END
35 RESULT
36 New size of the file or -1 in case of an error.
37 IoErr() gives additional information in that case.
39 NOTES
41 EXAMPLE
43 BUGS
45 SEE ALSO
47 INTERNALS
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 /* Get pointer to filehandle */
54 struct FileHandle *fh = BADDR(file);
55 LONG status;
57 status = dopacket3(DOSBase, NULL, fh->fh_Type, ACTION_SET_FILE_SIZE, fh->fh_Arg1, offset, mode);
59 return status;
61 AROS_LIBFUNC_EXIT
62 } /* SetFileSize */