revert between 56095 -> 55830 in arch
[AROS.git] / rom / dos / createdir.c
blob6b3be204c59e42ade2b962faa3b8ee2ec47e9c32
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Create a new directory.
6 Lang: English
7 */
9 #include <aros/debug.h>
10 #include <exec/memory.h>
11 #include <proto/exec.h>
12 #include <utility/tagitem.h>
13 #include <dos/dos.h>
14 #include <proto/dos.h>
15 #include <proto/utility.h>
16 #include "dos_intern.h"
18 /*****************************************************************************
20 NAME */
21 #include <proto/dos.h>
23 AROS_LH1(BPTR, CreateDir,
25 /* SYNOPSIS */
26 AROS_LHA(CONST_STRPTR, name, D1),
28 /* LOCATION */
29 struct DosLibrary *, DOSBase, 20, Dos)
31 /* FUNCTION
32 Creates a new directory under the given name. If all went well, an
33 exclusive lock on the new diretory is returned.
35 INPUTS
36 name - NUL terminated name.
38 RESULT
39 Exclusive lock to the new directory or 0 if it couldn't be created.
40 IoErr() gives additional information in that case.
42 NOTES
44 EXAMPLE
46 BUGS
48 SEE ALSO
50 INTERNALS
52 *****************************************************************************/
54 AROS_LIBFUNC_INIT
56 BPTR lock = BNULL;
57 struct PacketHelperStruct phs;
59 D(bug("[CreateDir] '%s'\n", name));
61 if (getpacketinfo(DOSBase, name, &phs)) {
62 lock = (BPTR)dopacket2(DOSBase, NULL, phs.port, ACTION_CREATE_DIR, phs.lock, phs.name);
63 freepacketinfo(DOSBase, &phs);
66 return lock;
68 AROS_LIBFUNC_EXIT
69 } /* CreateDir */