Skip to content

a c lib header-only for creating, manipulating and building directories.

License

Notifications You must be signed in to change notification settings

KiamMota/libmkdir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libmkdir v2.1

The libmkdir is a library that offers abstraction for manipulation, generation and removal of directories in cross-platform C, completely single-header.

functions

 int dirmk(const char* name);

Creates a directory (recursively or not). Returns 0 if successful.

int direxists(const char* name);

Checks if a directory exists (recursively or not). Returns 0 if successful.

int dirisemp(const char* name);

Checks whether a directory is empty or not, returning 1 or 0 respectively.

int dirrm(const char* name);

Removes an empty directory (recursively or not). Returns 0 if successful.

int dirmv(const char* old_name, const char* new_name);

Function capable of both renaming and moving a directory. Returns 0 if successful.

char* dirgetcur();

Returns the absolute path of the default directory. Returns 0 if successful.

int dirsetcur(const char* name);

Sets the current directory of the process. Returns 0 if successful.

void dircnt(const char* path, signed long* it, short recursive);

Counts directories in the specified path.

  • path: the path to the directory to scan.
  • it: pointer to a signed long that will store the number of directories counted.
  • recursive: if non-zero, counts directories recursively; if zero, counts only the immediate subdirectories.

void dircntall(const char* path, signed long* it, short recursive)

Counts directories in the specified path and files and other logical blocks.

  • path: the path to the directory to scan.
  • it: pointer to a signed long that will store the number of directories counted.
  • recursive: if non-zero, counts directories recursively; if zero, counts only the immediate subdirectories.

About

a c lib header-only for creating, manipulating and building directories.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors