BFLibC 0.1
C Library
Loading...
Searching...
No Matches
filesystem.h File Reference
#include <stdbool.h>
Include dependency graph for filesystem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

unsigned long long BFFileSystemDirectoryGetSizeUsed (const char *path, unsigned char options, int *error)
 
unsigned long long BFFileSystemFileGetSizeUsed (const char *path, unsigned char options, int *error)
 
unsigned long long BFFileSystemPathGetSizeAvailable (const char *path, int *error)
 
bool BFFileSystemPathExists (const char *path)
 
bool BFFileSystemPathIsFile (const char *path)
 
bool BFFileSystemPathIsDirectory (const char *path)
 
bool BFFileSystemPathIsSymbolicLink (const char *path)
 
char * BFFileSystemPathCopyHomePath (int *err)
 
int BFFileSystemGetOSTempDirectory (char *path)
 
int BFFileSystemPathGetExtension (const char *path, char *buf)
 
int BFFileSystemPathGetName (const char *path, char *ret)
 
int BFFileSystemPathGetFullname (const char *path, char *ret)
 
int BFFileSystemRemoveAll (const char *path)
 

Function Documentation

◆ BFFileSystemDirectoryGetSizeUsed()

unsigned long long BFFileSystemDirectoryGetSizeUsed ( const char * path,
unsigned char options,
int * err )

Calculates the directory size recursively

options: using anything from the kCalculationSizeOptions... set

author: Brando date: 6/2/22

Here is the call graph for this function:

◆ BFFileSystemFileGetSizeUsed()

unsigned long long BFFileSystemFileGetSizeUsed ( const char * path,
unsigned char options,
int * error )

Calculates the file size of the path

Here is the call graph for this function:

◆ BFFileSystemGetOSTempDirectory()

int BFFileSystemGetOSTempDirectory ( char * path)

returns operating system's tmp directory

◆ BFFileSystemPathCopyHomePath()

char * BFFileSystemPathCopyHomePath ( int * err)

Returns a copy of the home path for the user in scope

Caller must free

Here is the call graph for this function:

◆ BFFileSystemPathExists()

bool BFFileSystemPathExists ( const char * path)

Tests if path exists

◆ BFFileSystemPathGetExtension()

int BFFileSystemPathGetExtension ( const char * path,
char * buf )

Upon success, buf will have the file extension for the input path. If no input path was found, nothing will change in buf and no error code will be returned.

An error code will be returned for a fundamental issue like the parameters being null

If buf does not have enough space for the file extension string, undefined behavior will occur

◆ BFFileSystemPathGetFullname()

int BFFileSystemPathGetFullname ( const char * path,
char * ret )

returns basename + extension

◆ BFFileSystemPathGetName()

int BFFileSystemPathGetName ( const char * path,
char * ret )

if file, returns basename without file extension else, returns leaf component

Here is the call graph for this function:

◆ BFFileSystemPathGetSizeAvailable()

unsigned long long BFFileSystemPathGetSizeAvailable ( const char * path,
int * error )

Returns the available space in bytes for the path

◆ BFFileSystemPathIsDirectory()

bool BFFileSystemPathIsDirectory ( const char * path)

Tests if path is a directory

◆ BFFileSystemPathIsFile()

bool BFFileSystemPathIsFile ( const char * path)

Tests if path is a file

◆ BFFileSystemPathIsSymbolicLink()

bool BFFileSystemPathIsSymbolicLink ( const char * path)

Tests if the path is a symbolic link

◆ BFFileSystemRemoveAll()

int BFFileSystemRemoveAll ( const char * path)

Recursively removes path

Here is the call graph for this function: