2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Set the protection bits of a file.
8 #include <proto/exec.h>
9 #include <dos/dosextens.h>
10 #include <dos/filesystem.h>
11 #include <proto/dos.h>
12 #include "dos_intern.h"
14 /*****************************************************************************
17 #include <proto/dos.h>
19 AROS_LH2(BOOL
, 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 *****************************************************************************/
51 AROS_LIBBASE_EXT_DECL(struct DosLibrary
*,DOSBase
)
53 /* Get pointer to I/O request. Use stackspace for now. */
54 struct IOFileSys iofs
;
56 /* Prepare I/O request. */
57 InitIOFS(&iofs
, FSA_SET_PROTECT
, DOSBase
);
59 iofs
.io_Union
.io_SET_PROTECT
.io_Protection
= protect
;
61 return !DoName(&iofs
, name
, DOSBase
);