2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
8 #include <proto/exec.h>
10 #include "dos_intern.h"
12 /*****************************************************************************
15 #include <proto/dos.h>
17 AROS_LH2(LONG
, Relabel
,
20 AROS_LHA(CONST_STRPTR
, drive
, D1
),
21 AROS_LHA(CONST_STRPTR
, newname
, D2
),
24 struct DosLibrary
*, DOSBase
, 120, Dos
)
28 Change names of a volume.
32 drive -- The name of the device to rename (including the ':').
33 newname -- The new name for the device (without the ':').
37 A boolean telling whether the name change was successful or not.
49 *****************************************************************************/
52 AROS_LIBBASE_EXT_DECL(struct DosLibrary
*,DOSBase
)
54 struct IOFileSys iofs
;
56 /* Prepare I/O request. */
57 InitIOFS(&iofs
, FSA_RELABEL
, DOSBase
);
59 iofs
.IOFS
.io_Device
= GetDevice(drive
, &iofs
.IOFS
.io_Unit
, DOSBase
);
61 if(iofs
.IOFS
.io_Device
== NULL
)
66 iofs
.io_Union
.io_RELABEL
.io_NewName
= newname
;
67 iofs
.io_Union
.io_RELABEL
.io_Result
= FALSE
;
71 SetIoErr(iofs
.io_DosError
);
73 if(iofs
.io_DosError
!= 0)
78 return iofs
.io_Union
.io_RELABEL
.io_Result
? DOSTRUE
: DOSFALSE
;