2 Copyright © 2004, The AROS Development Team. All rights reserved.
3 This file is part of the PrefsEditor class, which is distributed under
4 the terms of version 2.1 of the GNU Lesser General Public License.
9 #include <exec/types.h>
10 #include <proto/dos.h>
11 #include <proto/utility.h>
12 #include <proto/exec.h>
15 #include <aros/debug.h>
19 /* Note: buffer *MUST* be large enough for atleast strlen(prefix) + 8 + 1 */
20 BPTR
CreateTemporary(STRPTR buffer
, CONST_STRPTR prefix
)
26 sprintf(buffer
, "%s%08lx", prefix
, (long)GetUniqueID());
27 fh
= Open(buffer
, MODE_NEWFILE
);
33 else if (IoErr() != ERROR_OBJECT_EXISTS
)
40 BOOL
MakeDir(CONST_STRPTR path
)
42 BPTR lock
= CreateDir(path
);
53 BOOL
MakeDirs(STRPTR path
)
59 for (position
= path
; *position
!= '\0'; position
++)
65 if ((lock
= Lock(path
, SHARED_LOCK
)) != BNULL
)
72 success
= MakeDir(path
);
77 if (!success
) return FALSE
;