#include <rtl.h>
int fvol (
const char *drive, /* drive letter */
char *buf); /* buffer where label will be written */
Description
The function fvol reads the volume label.
Parameter drive is a string specifying the volume drive.
The default drive is used if an empty string is provided.
Parameter buf specifies a buffer where volume label will be
stored as a NULL-terminated string. The size must be at least 12
bytes. If the volume has no label, then an empty string is
returned.
Return Value
0 - on success.
1 - to many opened files
2 - non existing drive
3 - drive read error
4 - drive not supported
Example
#include <rtl.h>
void cmd_vol (void) {
char label_buf[12];
if (fvol ("M0:", label_buf) == 0) {
if (label_buf[0]) {
printf ("Volume in drive M0 is %s\n", label_buf);
}
else {
printf ("Volume in drive M0 has no label.\n");
}
}
else {
printf ("Volume access error");
}
}
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.