2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
5 Desc: Check if a device is a filesystem.
9 #include <aros/debug.h>
10 #include <proto/exec.h>
11 #include <dos/dosextens.h>
12 #include <proto/utility.h>
13 #include "dos_intern.h"
16 /*****************************************************************************
19 #include <proto/dos.h>
21 AROS_LH1(BOOL
, IsFileSystem
,
24 AROS_LHA(CONST_STRPTR
, devicename
, D1
),
27 struct DosLibrary
*, DOSBase
, 118, Dos
)
30 Query the device whether it is a filesystem.
33 devicename - Name of the device to query.
36 TRUE if the device is a filesystem, FALSE otherwise.
39 DF0:, HD0:, ... are filesystems.
40 CON:, PIPE:, AUX:, ... are not
42 In AmigaOS if devicename contains no ":" then result
43 is always TRUE. Also volume and assign names return
54 *****************************************************************************/
58 LONG err
= ERROR_OBJECT_NOT_FOUND
;
60 struct DevProc
*dvp
= NULL
;
62 /* The Open() aliases '*' and 'CONSOLE:'
63 * are never filesystems
65 if (Stricmp(devicename
, "*") == 0 ||
66 Stricmp(devicename
, "CONSOLE:") == 0) {
71 /* We can't call GetDeviceProc() on CON: nor RAW:,
72 * since that will (implicitly) cause a window to
75 if (Stricmp(devicename
, "CON:") == 0 ||
76 Stricmp(devicename
, "RAW:") == 0) {
82 if ((dvp
= GetDeviceProc(devicename
, dvp
))) {
83 if (dvp
->dvp_Port
!= NULL
) // No port? Not a filesystem
84 code
= dopacket0(DOSBase
, NULL
, dvp
->dvp_Port
, ACTION_IS_FILESYSTEM
);