2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Set the protection bits of a file.
8 #include <aros/debug.h>
9 #include <proto/exec.h>
10 #include <dos/dosextens.h>
11 #include <proto/dos.h>
12 #include "dos_intern.h"
14 /*****************************************************************************
17 #include <proto/dos.h>
19 AROS_LH2(LONG
, SetProtection
,
22 AROS_LHA(CONST_STRPTR
, name
, D1
),
23 AROS_LHA(ULONG
, protect
, D2
),
26 struct DosLibrary
*, DOSBase
, 31, Dos
)
31 name - name of the file
32 protect - new protection bits
35 != 0 if all went well, 0 else. IoErr() gives additional
36 information in that case.
48 *****************************************************************************/
53 struct PacketHelperStruct phs
;
55 D(bug("[SetProtection] '%s':%x\n", name
, protect
));
57 if (getpacketinfo(DOSBase
, name
, &phs
)) {
58 status
= dopacket4(DOSBase
, NULL
, phs
.port
, ACTION_SET_PROTECT
, BNULL
, phs
.lock
, phs
.name
, protect
);
59 freepacketinfo(DOSBase
, &phs
);