update copyright
[AROS.git] / rom / dos / setfiledate.c
blob3b666dedad9668ecf945a8681ac83134b1c43f8b
1 /*
2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Change the date of a file.
6 Lang: English
7 */
9 #include <string.h>
10 #include <aros/debug.h>
11 #include <proto/exec.h>
12 #include <dos/dosextens.h>
13 #include <proto/dos.h>
14 #include "dos_intern.h"
16 /*****************************************************************************
18 NAME */
19 #include <proto/dos.h>
20 #include <dos/dos.h>
22 AROS_LH2(BOOL, SetFileDate,
24 /* SYNOPSIS */
25 AROS_LHA(CONST_STRPTR, name, D1),
26 AROS_LHA(const struct DateStamp *, date, D2),
28 /* LOCATION */
29 struct DosLibrary *, DOSBase, 66, Dos)
31 /* FUNCTION
32 Change the modification time of a file or directory.
34 INPUTS
35 name - name of the file
36 date - new file time
38 RESULT
39 Boolean success indicator. IoErr() gives additional information upon
40 failure.
42 NOTES
44 EXAMPLE
46 BUGS
48 SEE ALSO
50 INTERNALS
52 *****************************************************************************/
54 AROS_LIBFUNC_INIT
56 struct PacketHelperStruct phs;
57 LONG status = DOSFALSE;
59 D(bug("[SetFileDate] '%s' %x\n", name, date));
61 if (getpacketinfo(DOSBase, name, &phs)) {
62 status = dopacket4(DOSBase, NULL, phs.port, ACTION_SET_DATE, (IPTR)NULL, phs.lock, phs.name, (IPTR)date);
63 freepacketinfo(DOSBase, &phs);
66 return status;
68 AROS_LIBFUNC_EXIT
69 } /* SetFileDate */