- Notifications
You must be signed in to change notification settings - Fork0
File System utility functions.
License
NotificationsYou must be signed in to change notification settings
sagiegurari/c_fsio
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
File System functions and utilities.
This library provides a set of utility functions to work with the file system.
This includes writing/append text files with automatic directory creation, creating full directory path and more.
#include"fsio.h"#include<stdbool.h>#include<stdio.h>intmain(){// simple examples of writing/appending/reading text fileschar*file="./somedir/myfile.txt";booldone=fsio_write_text_file(file,"some text\n");printf("Text file written: %d\n",done);done=fsio_append_text_file(file,"more text\n");printf("Text file appended: %d\n",done);char*text=fsio_read_text_file(file);printf("Read text:\n%s\n",text);// creating a full directory pathdone=fsio_mkdirs("./somedir/dir1/dir2/dir3",FSIO_MODE_ALL);printf("Created directories: %d\n",done);// chmod to all permissions recursivelydone=fsio_chmod_recursive("./somedir/",FSIO_MODE_ALL);printf("Chmod done: %d\n",done);// recursive delete or files and directoriesdone=fsio_remove("./somedir");printf("Deleted somedir and all content.\n");}
SeeChangelog
Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.
About
File System utility functions.
Topics
Resources
License
Stars
Watchers
Forks
Packages0
No packages published