r4722@vps: verhaegs | 2007-05-06 13:11:19 -0400
[cake.git] / rom / dos / relabel.c
blob838b05e79acdf996be8f2bf64be1e43ea2d2f955
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
8 #include <proto/exec.h>
10 #include "dos_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <proto/dos.h>
17 AROS_LH2(LONG, Relabel,
19 /* SYNOPSIS */
20 AROS_LHA(CONST_STRPTR, drive, D1),
21 AROS_LHA(CONST_STRPTR, newname, D2),
23 /* LOCATION */
24 struct DosLibrary *, DOSBase, 120, Dos)
26 /* FUNCTION
28 Change names of a volume.
30 INPUTS
32 drive -- The name of the device to rename (including the ':').
33 newname -- The new name for the device (without the ':').
35 RESULT
37 A boolean telling whether the name change was successful or not.
39 NOTES
41 EXAMPLE
43 BUGS
45 SEE ALSO
47 INTERNALS
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 struct IOFileSys iofs;
55 /* Prepare I/O request. */
56 InitIOFS(&iofs, FSA_RELABEL, DOSBase);
58 iofs.IOFS.io_Device = GetDevice(drive, &iofs.IOFS.io_Unit, DOSBase);
60 if(iofs.IOFS.io_Device == NULL)
62 return DOSFALSE;
65 iofs.io_Union.io_RELABEL.io_NewName = newname;
66 iofs.io_Union.io_RELABEL.io_Result = FALSE;
68 DosDoIO(&iofs.IOFS);
70 SetIoErr(iofs.io_DosError);
72 if(iofs.io_DosError != 0)
74 return DOSFALSE;
77 return iofs.io_Union.io_RELABEL.io_Result ? DOSTRUE : DOSFALSE;
79 AROS_LIBFUNC_EXIT
80 } /* Relabel */