le_dir.h File Reference

Go to the source code of this file.

Functions

le_result_t le_dir_Make (const char *pathNamePtr, mode_t mode)
 
le_result_t le_dir_MakePath (const char *pathNamePtr, mode_t mode)
 
le_result_t le_dir_RemoveRecursive (const char *pathNamePtr)
 
bool le_dir_IsDir (const char *pathNamePtr)
 

Detailed Description

Legato Directory API include file.

Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.

Function Documentation

bool le_dir_IsDir ( const char *  pathNamePtr)

Checks if the path refers to a directory.

Returns
true if the path refers to a directory. false otherwise.
Parameters
[in]pathNamePtrThe path to the directory.
le_result_t le_dir_Make ( const char *  pathNamePtr,
mode_t  mode 
)

Creates a directory with permissions specified in mode.

Note
Permissions for the created directory will depend on the calling process' umask.
Returns
LE_OK if successful. LE_DUPLICATE if the directory already exists. LE_FAULT if there was an error.
Parameters
[in]pathNamePtrPath name to the directory to create.
[in]modePermissions for the directory.
le_result_t le_dir_MakePath ( const char *  pathNamePtr,
mode_t  mode 
)

Creates all directories in the path. If some (or all) directories in the path already exist, those directories are left as is. All created directories have the same permissions (specified in mode).

Note
Permissions for the created directories will depend on the calling process' umask.
Returns
LE_OK if successful. LE_FAULT if there was an error.
Parameters
[in]pathNamePtrPath containing all the directories to create.
[in]modePermissions for all created directories.
le_result_t le_dir_RemoveRecursive ( const char *  pathNamePtr)

Removes a directory by first recursively removing sub-directories, files, symlinks, hardlinks, devices, etc. Symlinks are not followed; only the links themselves are deleted.

A file or device may not be able to be removed if it is busy, in which case an error message is logged and LE_FAULT is returned.

Returns
LE_OK if successful. LE_FAULT if there was an error.
Parameters
[in]pathNamePtrPath to the directory to remove.