## f_setlabel

The f_setlabel function sets/removes the label of a volume.

    FRESULT f_setlabel (
      const TCHAR* name  /* [IN] Volume label to be set */
    );

#### Parameters

name
  Pointer to the nul-terminated string specifying the volume label to be set.

#### Return Values

FR_OK, FR_DISK_ERR, FR_INT_ERR, FR_NOT_READY, FR_INVALID_NAME, FR_WRITE_PROTECTED, FR_INVALID_DRIVE, FR_NOT_ENABLED, FR_NO_FILESYSTEM, FR_TIMEOUT

#### Description

When the string has a drive number, the volume label will be set to the volume specified by the drive number. If the volume label is a null-string, the volume label on the volume will be removed. The format of the volume label is similar to the SFN but there are some difference shown below:

- 11 bytes or less in length as local character code.
- Cannot contain period.
- Can contain spaces anywhere in the name.

#### QuickInfo

Available when `_FS_READONLY == 0` and `_USE_LABEL == 1`.

#### Example

        /* Set volume label to the default drive */
        f_setlabel("DATA DISK");

        /* Set volume label to the drive 2 */
        f_setlabel("2:DISK 3 OF 4");

        /* Remove volume label of the drive 2 */
        f_setlabel("2:");

#### See Also

`f_getlabel`

Return