Jump to main content

##

# 1.2.7.4.38 SYS_FS_CurrentDriveSet Function

## C

    SYS_FS_RESULT SYS_FS_CurrentDriveSet
    (
        const char* path
    );

## Summary

Sets the drive.

## Description

This function sets the present drive to the one as specified by the path. By default, the drive mounted last becomes the current drive for the system. This is useful for applications where only one drive (volume) is used. In such an application, there is no need to call the SYS_FS_CurrentDriveSet function.

However, in the case of an application where there are multiple volumes, the user can select the current drive for the application by calling this function.

## Precondition

The disk has to be mounted.

## Parameters

Param | Description
--- | ---
path | Path for the drive to be set.

## Returns

SYS_FS_RES_SUCCESS - Current drive set operation was successful.

SYS_FS_RES_FAILURE - Current drive set operation was unsuccessful. The reason for the failure can be retrieved with SYS_FS_Error.

## Example

    SYS_FS_RESULT res;

    res = SYS_FS_CurrentDriveSet("/mnt/myDrive");
    if(res == SYS_FS_RES_FAILURE)
    {
        // Drive change failed
    }

## Remarks

None.