⚠️ Warning
The library is currently being tested.
A single header implementation of std::filesystem/Boost.Filesystem in C89.
⚠️ Warning
The library will not compile in a C++ environment (yet).
Define CFS_IMPLEMENTATION in a C file instead.
// This should be done in a source file, not a header file.
// For Linux:
// #define _GNU_SOURCE (recommended, required for some functions, not required in C++).
// This should be defined as a compiler definition, not using a #define.
// If defined in a .c file, it should be above all #includes.
// For Windows:
// Be sure to use a toolchain that automatically defines _WIN32_WINNT
// to enable symlinks. _WIN32_WINNT is required to use symlinks
#define CFS_IMPLEMENTATION
#include <cfs/cfs.h>| Windows | Linux |
|---|---|
| Windows 95+* | Any |
* Only compatibility with Windows 2000+ are tested in a VM. Older Windows
versions are checked by modifying the _WIN32_WINNT value.
Some specific fixes are implemented for FreeBSD and Darwin but compatibility
won't be tested.
std::filesystem implementation across compilers is extremely inconsistent. This
library adopts the most common or logical way across various implementations,
or a custom one.
- On
Windows, paths aboveMAX_PATH(260 chars) length are supported. - Empty paths
""are not transformed in"."andNULLpaths are treated as an error inDebug(fs_cfs_error_invalid_argument) or undefined behaviour inReleasemode. fs_file_time_typeis based on the UNIX epoch on all OSs.fs_hard_link_countalways does not include the file itself as a link for consistency across operating systems.