2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: Delete a file or directory.
8 #include <aros/debug.h>
9 #include <exec/memory.h>
10 #include <proto/exec.h>
11 #include <utility/tagitem.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 *****************************************************************************/
56 struct PacketHelperStruct phs
;
58 D(bug("[DeleteFile] '%s'\n", name
));
60 if (getpacketinfo(DOSBase
, name
, &phs
)) {
61 status
= dopacket2(DOSBase
, NULL
, phs
.port
, ACTION_DELETE_OBJECT
, phs
.lock
, phs
.name
);
62 freepacketinfo(DOSBase
, &phs
);