libcmutils 0.6.5
Multi-platform C99 utility library
Loading...
Searching...
No Matches
Files, directories and file streams.

Data Structures

struct  CMUTIL_FileList
 A list of files in a directory. More...
 
struct  CMUTIL_FileStream
 File stream object for reading and writing files. More...
 
struct  CMUTIL_File
 A file or directory object. More...
 

Enumerations

enum  CMFileOpenMode { CMFileOpenRead = 0 , CMFileOpenWrite , CMFileOpenAppend }
 File open mode enumeration. More...
 

Functions

CMUTIL_FileCMUTIL_FileCreate (const char *path)
 Create a file or directory object for the specified path.
 
CMBool CMUTIL_PathCreate (const char *path, uint32_t mode)
 Create directories recursively for the specified path.
 

Detailed Description

Enumeration Type Documentation

◆ CMFileOpenMode

File open mode enumeration.

Enumerator
CMFileOpenRead 

Open file for reading.

CMFileOpenWrite 

Open file for writing (overwrite).

CMFileOpenAppend 

Open file for appending.

Function Documentation

◆ CMUTIL_FileCreate()

CMUTIL_File * CMUTIL_FileCreate ( const char *  path)

Create a file or directory object for the specified path.

Parameters
pathThe file or directory path.
Returns
A pointer to the newly created CMUTIL_File object, or NULL on failure.

◆ CMUTIL_PathCreate()

CMBool CMUTIL_PathCreate ( const char *  path,
uint32_t  mode 
)

Create directories recursively for the specified path.

This function creates all necessary parent directories for the given path if they do not already exist.

Parameters
pathThe directory path to create.
modeThe permissions to set for newly created directories.
Returns
CMTrue on success, CMFalse on failure.