https://github.com/tapchute/fileaccess
C file I/O made easy.
https://github.com/tapchute/fileaccess
c99 cmake files filesystem io library utility wrapper
Last synced: 7 months ago
JSON representation
C file I/O made easy.
- Host: GitHub
- URL: https://github.com/tapchute/fileaccess
- Owner: TapChute
- License: zlib
- Created: 2025-01-06T18:09:49.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-06T19:55:34.000Z (about 1 year ago)
- Last Synced: 2025-06-25T04:49:24.521Z (7 months ago)
- Topics: c99, cmake, files, filesystem, io, library, utility, wrapper
- Language: C
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# FileAccess
C file I/O made easy.
*A simple wrapper around C file I/O.*
## Dependencies
*FileAccess* requires nothing but the C standard library *(commonly known as glibc or libc)* for wrappers around system/kernel calls.
Used functions are:
* `fopen` *(fopen_s on UCRT)* for getting file handles.
* `fclose` for closing file handles.
* `fread` for reading files.
* `fwrite` for writing to files.
* `malloc` for allocating memory.
* `free` for freeing memory.
* `fseek` for walking through the file.
* `ftell` for retrieving how far *we've* walked.
## Installation
To integrate the *FileAccess* library into your project, simply clone it using the [*CMake Package Manager (CPM)*](https://github.com/cpm-cmake/CPM.cmake) or by manually adding it to your project by downloading a release or using git to clone it in a separate directory.
### Making use of *CPM*:
*Installation of CPM*
```bash
mkdir -p cmake
wget -O cmake/CPM.cmake https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/get_cpm.cmake
```
*Fetching FileAccess*
```cmake
...
include("${CMAKE_CURRENT_LIST_DIR}/cmake/CPM.cmake")
CPMAddPackage("gh:SomeDudeNamedAnthony/FileAccess")
...
```
*Including it in your project's build.*
```cmake
...
target_link_library( fileaccess)
...
```
### Making use of Git submodules.
*Inside an existing git repository.*
*Adding the submodule:*
```bash
git submodule add "https://github.com/SomeDudeNamedAnthony/FileAccess"
```
### Making use of Git cloning
```bash
git clone "https://github.com/SomeDudeNamedAnthony/FileAccess"
```
`Note: Using submodules is preferred over manual installation for easy integration.`
## Licensing
To view the license for this project, please see [LICENSE.md](LICENSE.md)