2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
5 Desc: Check if a device is a filesystem.
8 #include <proto/exec.h>
9 #include <dos/dosextens.h>
10 #include <dos/filesystem.h>
11 #include <proto/utility.h>
12 #include "dos_intern.h"
16 # include <aros/debug.h>
18 /*****************************************************************************
21 #include <proto/dos.h>
23 AROS_LH1(BOOL
, IsFileSystem
,
26 AROS_LHA(CONST_STRPTR
, devicename
, D1
),
29 struct DosLibrary
*, DOSBase
, 118, Dos
)
32 Query the device whether it is a filesystem.
35 devicename - Name of the device to query.
38 TRUE if the device is a filesystem, FALSE otherwise.
41 DF0:, HD0:, ... are filesystems.
42 CON:, PIPE:, AUX:, ... are not
44 In AmigaOS if devicename contains no ":" then result
45 is always TRUE. Also volume and assign names return
56 *****************************************************************************/
60 struct IOFileSys iofs
;
63 /* console is never a filesystem */
64 if (Stricmp(devicename
, "CONSOLE:") == 0 || Stricmp(devicename
, "*") == 0)
67 InitIOFS(&iofs
, FSA_IS_FILESYSTEM
, DOSBase
);
68 err
= DoIOFS(&iofs
, NULL
, devicename
, DOSBase
);
70 /* XXX if err is ERROR_ACTION_NOT_KNOWN, we should try to lock the
71 * root. if we can get a lock, then it's a filesystem */
76 return iofs
.io_Union
.io_IS_FILESYSTEM
.io_IsFilesystem
;