Mstdlib-1.24.0
File System Operations

Functions

M_fs_error_t M_fs_symlink (const char *target, const char *link_name)
 
M_fs_error_t M_fs_move (const char *path_old, const char *path_new, M_uint32 mode, M_fs_progress_cb_t cb, M_uint32 progress_flags)
 
M_fs_error_t M_fs_copy (const char *path_old, const char *path_new, M_uint32 mode, M_fs_progress_cb_t cb, M_uint32 progress_flags)
 
M_fs_error_t M_fs_delete (const char *path, M_bool remove_children, M_fs_progress_cb_t cb, M_uint32 progress_flags)
 

Detailed Description

Function Documentation

◆ M_fs_symlink()

M_fs_error_t M_fs_symlink ( const char *  target,
const char *  link_name 
)

Create a soft link.

Parameters
[in]targetThe target to link.
[in]link_nameThe link to create.
Returns
Result.

◆ M_fs_move()

M_fs_error_t M_fs_move ( const char *  path_old,
const char *  path_new,
M_uint32  mode,
M_fs_progress_cb_t  cb,
M_uint32  progress_flags 
)

Move a file or directory from one location to another.

If moving a file to an existing directory the file will be copied into the directory with the same name.

Parameters
[in]path_oldThe file to move.
[in]path_newThe location the file should be moved to.
[in]modeM_fs_file_mode_t mode. Only supports OVERWRITE. If overwrite is set the move will overwrite the file if it exists. Without this set the move operation will fail if the file exists.
[in]cbProgress callback that should be called.
[in]progress_flagsM_fs_progress_flags_t flags to control what data should be set in the progress callback.
Returns
Result.

◆ M_fs_copy()

M_fs_error_t M_fs_copy ( const char *  path_old,
const char *  path_new,
M_uint32  mode,
M_fs_progress_cb_t  cb,
M_uint32  progress_flags 
)

Copy a file or directory to a new location.

If copying a file to an existing directory the file will be copied into the directory with the same name.

Parameters
[in]path_oldThe file to move.
[in]path_newThe location the file should be copied to.
[in]modeM_fs_file_mode_t mode. Only supports OVERWRITE. If overwrite is set the move will overwrite the file if it exists. Without this set the move operation will fail if the file exists.
[in]cbProgress callback that should be called.
[in]progress_flagsM_fs_progress_flags_t flags to control what data should be set in the progress callback.
Returns
Result.

◆ M_fs_delete()

M_fs_error_t M_fs_delete ( const char *  path,
M_bool  remove_children,
M_fs_progress_cb_t  cb,
M_uint32  progress_flags 
)

Delete a file or directory.

Parameters
[in]pathThe file to delete.
[in]remove_childrenOnly applies to directories. If M_TRUE all contents of the directory will be removed in addition to the directory itself. If M_FALSE and the directory is not empty an error will be returned.
[in]cbProgress callback function. Most useful when deleting a directory with children and remove_children is M_TRUE. Will be called after a delete action is completed (each child is deleted and the passed path itself is deleted).
[in]progress_flagsM_fs_progress_flags_t flags to control what data should be set in the progress callback.
Returns
Result.