2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
6 #include <proto/arossupport.h>
8 #include <proto/utility.h>
10 #include <aros/system.h>
13 #include <dos/dosextens.h>
14 #include <exec/types.h>
15 #include <utility/utility.h>
17 #define BUFFER_SIZE 100
19 /*****************************************************************************
34 There is a need in file/directory processing where an application
35 may need to determine whether a path is just a volume/device or
40 Name - The path to test.
42 Flags - Any combination of the following:
50 Boolean True or False.
54 Requires the programmer to open the utility.library and initialise
57 In future releases the buffer size will be set via a taglist.
65 Success = IsDosEntryA("Work:", LDF_VOLUMES)
81 27-Jul-1997 laguest Initial inclusion into the AROS tree
83 ******************************************************************************/
85 struct DosList
*DList
;
90 char Buffer
[BUFFER_SIZE
+ 1];
94 DOSBase
= OpenLibrary("dos.library", 0);
98 UtilityBase
= OpenLibrary("utility.library", 0);
99 if (UtilityBase
== NULL
) {
100 CloseLibrary(DOSBase
);
106 Position
= SplitName(Name
, ':', &Buffer
[0], 0, BUFFER_SIZE
+ 1);
107 if (Position
!= -1 && Name
[Position
] == 0)
109 DList
= AttemptLockDosList(Flags
| LDF_READ
);
112 DList
= NextDosEntry(DList
, Flags
);
113 while (DList
!= NULL
&& ReturnValue
== FALSE
)
115 DLName
= AROS_BSTR_ADDR(DList
->dol_Name
);
117 Success
= Strnicmp(DLName
, &Buffer
[0], Position
- 1);
123 DList
= NextDosEntry(DList
, Flags
);
126 UnLockDosList(Flags
| LDF_READ
);
130 CloseLibrary(UtilityBase
);
131 CloseLibrary(DOSBase
);
132 return (ReturnValue
);