muimaster.library: migrate event handling from Listview to List
[AROS.git] / workbench / c / DiskChange.c
blob947417db2345a2b8360bdc8ade27fd5c8ff03cc4
1 /*
2 Copyright © 2007-2014, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: DiskChange CLI command
6 Lang: English
7 */
8 /******************************************************************************
10 NAME
12 Diskchange
14 FORMAT
16 Diskchange DEVICE
18 SYNOPSIS
20 DEVICE/A
22 LOCATION
26 FUNCTION
28 Diskchange is intended only for removable media. For example if
29 you have a internal floppy disk dive set to noclick AROS will not
30 perform disk presence check. So you have to manually update any
31 disk change made.
33 INPUTS
35 DEVICE -- The disk device unit.
37 RESULT
39 NOTES
41 EXAMPLE
43 Diskchange df0:
45 BUGS
47 SEE ALSO
49 INTERNALS
51 HISTORY
53 ******************************************************************************//*****************************************************************************************/
55 #include <proto/dos.h>
57 #include <dos/dos.h>
58 #include <exec/types.h>
60 const TEXT __version__[] = "\0$VER: DiskChange 41.2 (2.4.2014)";
61 int __nocommandline;
63 int main(void)
65 struct RDArgs *ra;
66 STRPTR dev;
67 int rc = RETURN_FAIL;
68 LONG error = 0;
70 ra = ReadArgs("DEVICE/A", (IPTR *)&dev, NULL);
71 if (ra) {
72 if (Inhibit(dev, DOSTRUE) && Inhibit(dev, DOSFALSE))
73 rc = RETURN_OK;
74 error = IoErr();
75 FreeArgs(ra);
77 PrintFault(error, "DiskChange");
78 return rc;