2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Delete a file or directory.
8 #include <exec/memory.h>
9 #include <proto/exec.h>
10 #include <utility/tagitem.h>
12 #include <dos/filesystem.h>
13 #include <proto/dos.h>
14 #include <proto/utility.h>
15 #include "dos_intern.h"
17 /*****************************************************************************
20 #include <proto/dos.h>
22 AROS_LH1(BOOL
, DeleteFile
,
25 AROS_LHA(CONST_STRPTR
, name
, D1
),
28 struct DosLibrary
*, DOSBase
, 12, Dos
)
31 Tries to delete a file or directory by a given name.
32 May fail if the file is in use or protected from deletion.
35 name - NUL terminated name.
38 != 0 if the file is gone, 0 if is still there.
39 IoErr() gives additional information in that case.
51 *****************************************************************************/
55 /* Get pointer to I/O request. Use stackspace for now. */
56 struct IOFileSys iofs
;
58 /* Prepare I/O request. */
59 InitIOFS(&iofs
, FSA_DELETE_OBJECT
, DOSBase
);
61 if (DoIOFS(&iofs
, NULL
, name
, DOSBase
) == 0)