r4722@vps: verhaegs | 2007-05-06 13:11:19 -0400
[cake.git] / rom / dos / deletefile.c
blob3e718240786c89b01b9f6b97ee85161aad9c82ba
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Delete a file or directory.
6 Lang: English
7 */
8 #include <exec/memory.h>
9 #include <proto/exec.h>
10 #include <utility/tagitem.h>
11 #include <dos/dos.h>
12 #include <dos/filesystem.h>
13 #include <proto/dos.h>
14 #include <proto/utility.h>
15 #include "dos_intern.h"
17 /*****************************************************************************
19 NAME */
20 #include <proto/dos.h>
22 AROS_LH1(BOOL, DeleteFile,
24 /* SYNOPSIS */
25 AROS_LHA(CONST_STRPTR, name, D1),
27 /* LOCATION */
28 struct DosLibrary *, DOSBase, 12, Dos)
30 /* FUNCTION
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.
34 INPUTS
35 name - NUL terminated name.
37 RESULT
38 != 0 if the file is gone, 0 if is still there.
39 IoErr() gives additional information in that case.
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
49 INTERNALS
51 *****************************************************************************/
53 AROS_LIBFUNC_INIT
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(DoName(&iofs, name, DOSBase) == 0)
62 return DOSTRUE;
63 else
64 return DOSFALSE;
66 AROS_LIBFUNC_EXIT
67 } /* DeleteFile */