Jump to main content

##

# 1.2.7.4.25 SYS_FS_DirOpen Function

## C

    SYS_FS_HANDLE SYS_FS_DirOpen
    (
        const char* path
    );

## Summary

Open a directory

## Description

This function opens the requested directory.

## Precondition

The volume on which the directory is present should be mounted.

## Parameters

Param | Description
--- | ---
path | Path to the directory along with the volume name. The string of volume and directory name has to be preceded by "/mnt/". Also, the volume name and directory name has to be separated by a slash "/". If the directory specified is only the root directory, the path has to be ended with "/".

## Returns

On success - a valid handle to the directory will be returned.

On failure - SYS_FS_HANDLE_INVALID will be returned. The reason for the failure can be retrieved with SYS_FS_Error.

## Example

    SYS_FS_HANDLE dirHandle;

    dirHandle = SYS_FS_DirOpen("/mnt/myDrive/Dir1");
    // For root directory, end with a "/"
    // dirHandle = SYS_FS_DirOpen("/mnt/myDrive/");

    if(dirHandle != SYS_FS_HANDLE_INVALID)
    {
        // Directory open is successful
    }

## Remarks

None