{"id":13438058,"url":"https://github.com/gulrak/filesystem","last_synced_at":"2025-05-14T07:08:22.034Z","repository":{"id":38084499,"uuid":"147116528","full_name":"gulrak/filesystem","owner":"gulrak","description":"An implementation of C++17 std::filesystem for C++11 /C++14/C++17/C++20 on Windows, macOS, Linux and FreeBSD.","archived":false,"fork":false,"pushed_at":"2025-01-23T06:26:01.000Z","size":917,"stargazers_count":1424,"open_issues_count":18,"forks_count":189,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-05-14T05:12:45.041Z","etag":null,"topics":["cpp","cpp11","cpp14","cpp17","cpp20","filesystem","freebsd","header-only","linux","macos","windows-10"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gulrak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-02T19:46:14.000Z","updated_at":"2025-05-13T17:42:44.000Z","dependencies_parsed_at":"2023-02-09T02:15:19.673Z","dependency_job_id":"f98f1c3d-592b-48d2-9ac4-ae0e54a528db","html_url":"https://github.com/gulrak/filesystem","commit_stats":{"total_commits":431,"total_committers":35,"mean_commits":"12.314285714285715","dds":"0.15545243619489557","last_synced_commit":"8a2edd6d92ed820521d42c94d179462bf06b5ed3"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulrak%2Ffilesystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulrak%2Ffilesystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulrak%2Ffilesystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gulrak%2Ffilesystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gulrak","download_url":"https://codeload.github.com/gulrak/filesystem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254092659,"owners_count":22013290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp11","cpp14","cpp17","cpp20","filesystem","freebsd","header-only","linux","macos","windows-10"],"created_at":"2024-07-31T03:01:02.598Z","updated_at":"2025-05-14T07:08:22.014Z","avatar_url":"https://github.com/gulrak.png","language":"C++","readme":"![Supported Platforms](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows%20%7C%20FreeBSD-blue.svg)\n![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)\n[![CMake Build Matrix](https://github.com/gulrak/filesystem/actions/workflows/build_cmake.yml/badge.svg?branch=master)](https://github.com/gulrak/filesystem/actions/workflows/build_cmake.yml)\n[![Build Status](https://ci.appveyor.com/api/projects/status/t07wp3k2cddo0hpo/branch/master?svg=true)](https://ci.appveyor.com/project/gulrak/filesystem)\n[![Build Status](https://api.cirrus-ci.com/github/gulrak/filesystem.svg?branch=master)](https://cirrus-ci.com/github/gulrak/filesystem)\n[![Coverage Status](https://coveralls.io/repos/github/gulrak/filesystem/badge.svg?branch=master)](https://coveralls.io/github/gulrak/filesystem?branch=master)\n[![Latest Release Tag](https://img.shields.io/github/tag/gulrak/filesystem.svg)](https://github.com/gulrak/filesystem/tree/v1.5.14)\n\u003c!-- [![Build Status](https://cloud.drone.io/api/badges/gulrak/filesystem/status.svg?ref=refs/heads/master)](https://cloud.drone.io/gulrak/filesystem) --\u003e\n\n\n\u003c!-- TOC --\u003e\n* [Filesystem](#filesystem)\n  * [Motivation](#motivation)\n  * [Why the namespace GHC?](#why-the-namespace-ghc)\n  * [Platforms](#platforms)\n  * [Tests](#tests)\n  * [Usage](#usage)\n    * [Downloads](#downloads)\n    * [Using it as Single-File-Header](#using-it-as-single-file-header)\n    * [Using it as Forwarding-/Implementation-Header](#using-it-as-forwarding-implementation-header)\n    * [Git Submodule and CMake](#git-submodule-and-cmake)\n    * [Versioning](#versioning)\n  * [Documentation](#documentation)\n    * [`ghc::filesystem::ifstream`, `ghc::filesystem::ofstream`, `ghc::filesystem::fstream`](#ghcfilesystemifstream--ghcfilesystemofstream--ghcfilesystemfstream)\n    * [`ghc::filesystem::u8arguments`](#ghcfilesystemu8arguments)\n  * [Differences](#differences)\n    * [LWG Defects](#lwg-defects)\n    * [Not Implemented on C++ before C++17](#not-implemented-on-c-before-c17)\n    * [Differences in API](#differences-in-api)\n      * [Differences of Specific Interfaces](#differences-of-specific-interfaces)\n    * [Differences in Behavior](#differences-in-behavior)\n      * [fs.path (ref)](#fspath--ref-)\n  * [Open Issues](#open-issues)\n    * [Windows](#windows)\n      * [Symbolic Links on Windows](#symbolic-links-on-windows)\n      * [Permissions](#permissions)\n  * [Release Notes](#release-notes)\n\u003c!-- TOC --\u003e\n\n# Filesystem\n\nThis is a header-only single-file `std::filesystem` compatible helper library,\nbased on the C++17 and C++20 specs, but implemented for C++11, C++14, C++17 or C++20\n(tightly following  the C++17 standard with very few documented exceptions). It is currently tested on\nmacOS 10.12/10.14/10.15/11.6, Windows 10, Ubuntu 18.04, Ubuntu 20.04, CentOS 7, CentOS 8, FreeBSD 12,\nAlpine ARM/ARM64 Linux and Solaris 10 but should work on other systems too, as long as you have\nat least a C++11 compatible compiler. It should work with Android NDK, Emscripten and I even\nhad reports of it being used on iOS (within sandboxing constraints) and with v1.5.6 there\nis experimental support for QNX. The support of Android NDK, Emscripten, QNX, and since 1.5.14\nGNU/Hurd and Haiku is not backed up by automated testing but PRs and bug reports are welcome\nfor those too and they are reported to work.\nIt is of course in its own namespace `ghc::filesystem` to not interfere with a regular `std::filesystem`\nshould you use it in a mixed C++17 environment (which is possible).\n\n*Test coverage is well above 90%, and starting with v1.3.6 and in v1.5.0\nmore time was invested in benchmarking and optimizing parts of the library. I'll try\nto continue to optimize some parts and refactor others, striving\nto improve it as long as it doesn't introduce additional C++17/C++20 compatibility\nissues. Feedback is always welcome. Simply open an issue if you see something missing\nor wrong or not behaving as expected and I'll comment.*\n\n\n## Motivation\n\nI'm often in need of filesystem functionality, mostly `fs::path`, but directory\naccess too, and when beginning to use C++11, I used that language update\nto try to reduce my third-party dependencies. I could drop most of what\nI used, but still missed some stuff that I started implementing for the\nfun of it. Originally I based these helpers on my own coding- and naming\nconventions. When C++17 was finalized, I wanted to use that interface,\nbut it took a while, to push myself to convert my classes.\n\nThe implementation is closely based on chapter 30.10 from the C++17 standard\nand a draft close to that version is\n[Working Draft N4687](https://github.com/cplusplus/draft/raw/master/papers/n4687.pdf).\nIt is from after the standardization of C++17 but it contains the latest filesystem\ninterface changes compared to the\n[Working Draft N4659](https://github.com/cplusplus/draft/raw/master/papers/n4659.pdf).\nStaring with v1.4.0, when compiled using C++20, it adapts to the changes according to path sorting order\nand `std::u8string` handling from [Working Draft N4860](https://isocpp.org/files/papers/N4860.pdf).\n\nI want to thank the people working on improving C++, I really liked how the language\nevolved with C++11 and the following standards. Keep on the good work!\n\n## Why the namespace GHC?\nIf you ask yourself, what `ghc` is standing for, it is simply\n`gulraks helper classes`, yeah, I know, not very imaginative, but I wanted a\nshort namespace and I use it in some of my private classes (so **it has nothing\nto do with Haskell**, sorry for the name clash).\n\n## Platforms\n\n`ghc::filesystem` is developed on macOS but CI tested on macOS, Windows,\nvarious Linux Distributions, FreeBSD and starting with v1.5.12 on Solaris.\nIt should work on any of these with a C++11-capable  compiler. Also there are some\nchecks to hopefully better work on Android, but  as I currently don't test with the\nAndroid NDK, I wouldn't call it a  supported platform yet, same is valid for using\nit with Emscripten. It is now  part of the detected platforms, I fixed the obvious\nissues and ran some tests with  it, so it should be fine. All in all, I don't see it\nreplacing `std::filesystem` where full C++17 or C++20 is available, it doesn't try\nto be a \"better\" `std::filesystem`, just an almost drop-in if you can't use it\n(with the exception  of the UTF-8 preference).\n\n:information_source: **Important:** _This implementation is following the [\"UTF-8 Everywhere\" philosophy](https://utf8everywhere.org/) in that all\n`std::string` instances will be interpreted the same as `std::u8string` encoding\nwise and as being in UTF-8. The `std::u16string` will be seen as UTF-16. See *Differences in API*\nfor more information._\n\nUnit tests are currently run with:\n\n* macOS 10.12: Xcode 9.2 (clang-900.0.39.2), GCC 9.2, Clang 9.0, macOS 10.13: Xcode 10.1, macOS 10.14: Xcode 11.2, macOS 10.15: Xcode 11.6, Xcode 12.4\n* Windows: Visual Studio 2017, Visual Studio 2015, Visual Studio 2019, MinGW GCC 6.3 (Win32), GCC 7.2 (Win64), Cygwin GCC 10.2 (no CI yet)\n* Linux (Ubuntu): GCC (5.5, 6.5, 7.4, 8.3, 9.2), Clang (5.0, 6.0, 7.1, 8.0, 9.0)\n* ~~Linux (Alpine ARM/ARM64): GCC 9.2.0~~ (The Drone build scripts stopped working,\n  as they where a contribution, I couldn't figure out what went wrong, any help appreciated.)\n* FreeBSD: Clang 8.0\n* Solaris: GCC 5.5 \n\n\n## Tests\n\nThe header comes with a set of unit-tests and uses [CMake](https://cmake.org/)\nas a build tool and [Catch2](https://github.com/catchorg/Catch2) as test framework.\nAll tests are registered with in CMake, so the [ctest](https://cmake.org/cmake/help/latest/manual/ctest.1.html)\ncommando can be used to run the tests. \n\nAll tests against this implementation should succeed, depending on your environment\nit might be that there are some warnings, e.g. if you have no rights to create\nSymlinks on Windows or at least the test thinks so, but these are just informative.\n\nTo build the tests from inside the project directory under macOS or Linux just:\n\n```cpp\nmkdir build\ncd build\ncmake -DCMAKE_BUILD_TYPE=Debug ..\nmake\nctest\n```\n\nThis generates the test binaries that run the tests and the last command executes\nthem.\n\nIf the default compiler is a GCC 8 or newer, or Clang 7 or newer, it\nadditionally tries to build a version of the test binary compiled against GCCs/Clangs\n`std::filesystem` implementation, named `std_filesystem_test`\nas an additional test of conformance. Ideally all tests should compile and\nsucceed with all filesystem implementations, but in reality, there are\nsome differences in behavior, sometimes due to room for interpretation in\nin the standard, and there might be issues in these implementations too.\n\n\n## Usage\n\n### Downloads\n\nThe latest release version is [v1.5.14](https://github.com/gulrak/filesystem/tree/v1.5.14) and\nsource archives can be found [here](https://github.com/gulrak/filesystem/releases/tag/v1.5.14).\n\nThe latest pre-native-backend version is [v1.4.0](https://github.com/gulrak/filesystem/tree/v1.4.0) and\nsource archives can be found [here](https://github.com/gulrak/filesystem/releases/tag/v1.4.0).\n\nThe latest pre-C++20-support release version is [v1.3.10](https://github.com/gulrak/filesystem/tree/v1.3.10) and\nsource archives can be found [here](https://github.com/gulrak/filesystem/releases/tag/v1.3.10).\n\nCurrently only the latest minor release version receives bugfixes, so if possible,\nyou should use the latest release.\n\n### Using it as Single-File-Header\n\nAs `ghc::filesystem` is at first a header-only library, it should be enough to copy the header\nor the `include/ghc` directory into your project folder or point your include path to this place and\nsimply include the `filesystem.hpp` header (or `ghc/filesystem.hpp` if you use the subdirectory).\n\nEverything is in the namespace `ghc::filesystem`, so one way to use it only as\na fallback could be:\n\n```cpp\n#if _MSVC_LANG \u003e= 201703L || __cplusplus \u003e= 201703L \u0026\u0026 defined(__has_include)\n    // ^ Supports MSVC prior to 15.7 without setting /Zc:__cplusplus to fix __cplusplus\n    // _MSVC_LANG works regardless. But without the switch, the compiler always reported 199711L: https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/\n    #if __has_include(\u003cfilesystem\u003e) // Two stage __has_include needed for MSVC 2015 and per https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005finclude.html\n        #define GHC_USE_STD_FS\n\n        // Old Apple OSs don't support std::filesystem, though the header is available at compile\n        // time. In particular, std::filesystem is unavailable before macOS 10.15, iOS/tvOS 13.0,\n        // and watchOS 6.0.\n        #ifdef __APPLE__\n            #include \u003cAvailability.h\u003e\n            // Note: This intentionally uses std::filesystem on any new Apple OS, like visionOS\n            // released after std::filesystem, where std::filesystem is always available.\n            // (All other __\u003cplatform\u003e_VERSION_MIN_REQUIREDs will be undefined and thus 0.)\n            #if __MAC_OS_X_VERSION_MIN_REQUIRED \u0026\u0026 __MAC_OS_X_VERSION_MIN_REQUIRED \u003c 101500 \\\n             || __IPHONE_OS_VERSION_MIN_REQUIRED \u0026\u0026 __IPHONE_OS_VERSION_MIN_REQUIRED \u003c 130000 \\\n             || __TV_OS_VERSION_MIN_REQUIRED \u0026\u0026 __TV_OS_VERSION_MIN_REQUIRED \u003c 130000 \\\n             || __WATCH_OS_VERSION_MAX_ALLOWED \u0026\u0026 __WATCH_OS_VERSION_MAX_ALLOWED \u003c 60000\n                #undef GHC_USE_STD_FS\n            #endif  \n        #endif\n    #endif\n#endif\n\n#ifdef GHC_USE_STD_FS\n    #include \u003cfilesystem\u003e\n    namespace fs = std::filesystem;\n#else\n    #include \"filesystem.hpp\"\n    namespace fs = ghc::filesystem;\n#endif\n```\n\nIf you want to also use the `fstream` wrapper with `path` support as fallback,\nyou might use:\n\n```cpp\n#if _MSVC_LANG \u003e= 201703L || __cplusplus \u003e= 201703L \u0026\u0026 defined(__has_include)\n    // ^ Supports MSVC prior to 15.7 without setting /Zc:__cplusplus to fix __cplusplus\n    // _MSVC_LANG works regardless. But without the switch, the compiler always reported 199711L: https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/\n    #if __has_include(\u003cfilesystem\u003e) // Two stage __has_include needed for MSVC 2015 and per https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005finclude.html\n        #define GHC_USE_STD_FS\n\n        // Old Apple OSs don't support std::filesystem, though the header is available at compile\n        // time. In particular, std::filesystem is unavailable before macOS 10.15, iOS/tvOS 13.0,\n        // and watchOS 6.0.\n        #ifdef __APPLE__\n            #include \u003cAvailability.h\u003e\n            // Note: This intentionally uses std::filesystem on any new Apple OS, like visionOS\n            // released after std::filesystem, where std::filesystem is always available.\n            // (All other __\u003cplatform\u003e_VERSION_MIN_REQUIREDs will be undefined and thus 0.)\n            #if __MAC_OS_X_VERSION_MIN_REQUIRED \u0026\u0026 __MAC_OS_X_VERSION_MIN_REQUIRED \u003c 101500 \\\n             || __IPHONE_OS_VERSION_MIN_REQUIRED \u0026\u0026 __IPHONE_OS_VERSION_MIN_REQUIRED \u003c 130000 \\\n             || __TV_OS_VERSION_MIN_REQUIRED \u0026\u0026 __TV_OS_VERSION_MIN_REQUIRED \u003c 130000 \\\n             || __WATCH_OS_VERSION_MAX_ALLOWED \u0026\u0026 __WATCH_OS_VERSION_MAX_ALLOWED \u003c 60000\n                #undef GHC_USE_STD_FS\n            #endif  \n        #endif\n    #endif\n#endif\n\n#ifdef GHC_USE_STD_FS\n    #include \u003cfilesystem\u003e\n    namespace fs {\n        using namespace std::filesystem;\n        using ifstream = std::ifstream;\n        using ofstream = std::ofstream;\n        using fstream = std::fstream;\n    }\n#else\n    #include \"filesystem.hpp\"\n    namespace fs {\n        using namespace ghc::filesystem;\n        using ifstream = ghc::filesystem::ifstream;\n        using ofstream = ghc::filesystem::ofstream;\n        using fstream = ghc::filesystem::fstream;\n    }\n#endif\n```\n\nNow you have e.g. `fs::ofstream out(somePath);` and it is either the wrapper or\nthe C++17 `std::ofstream`.\n\n:information_source: **Be aware, as a header-only library, it is not hiding the fact, that it\nuses system includes, so they \"pollute\" your global namespace. Use the\nforwarding-/implementation-header based approach (see below) to avoid this.\nFor Windows it needs `Windows.h` and it might be a good idea to define\n`WIN32_LEAN_AND_MEAN` or `NOMINMAX` prior to including `filesystem.hpp` or\n`fs_std.hpp` headers  to reduce pollution of your global namespace and compile\ntime. They are not defined by `ghc::filesystem` to allow combination with contexts\nwhere the full `Windows.h`is needed, e.g. for UI elements.**\n\n:information_source: **Hint:** There is an additional header named `ghc/fs_std.hpp` that implements this\ndynamic selection of a filesystem implementation, that you can include\ninstead of `ghc/filesystem.hpp` when you want `std::filesystem` where\navailable and `ghc::filesystem` where not.\n\n\n### Using it as Forwarding-/Implementation-Header\n\nAlternatively, starting from v1.1.0 `ghc::filesystem` can also be used by\nincluding one of two additional wrapper headers. These allow to include\na forwarded version in most places (`ghc/fs_fwd.hpp`) while hiding the\nimplementation details in a single cpp file that includes `ghc/fs_impl.hpp` to\nimplement the needed code. Using `ghc::filesystem` this way makes sure\nsystem includes are only visible from inside the cpp file, all other places are clean.\n\nBe aware, that it is currently not supported to hide the implementation\ninto a Windows-DLL, as a DLL interface with C++ standard templates in interfaces\nis a different beast. If someone is willing to give it a try, I might integrate\na PR but currently working on that myself is not a priority.\n\nIf you use the forwarding/implementation approach, you can still use the dynamic\nswitching like this:\n\n```cpp\n#if _MSVC_LANG \u003e= 201703L || __cplusplus \u003e= 201703L \u0026\u0026 defined(__has_include)\n    // ^ Supports MSVC prior to 15.7 without setting /Zc:__cplusplus to fix __cplusplus\n    // _MSVC_LANG works regardless. But without the switch, the compiler always reported 199711L: https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/\n    #if __has_include(\u003cfilesystem\u003e) // Two stage __has_include needed for MSVC 2015 and per https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005finclude.html\n        #define GHC_USE_STD_FS\n\n        // Old Apple OSs don't support std::filesystem, though the header is available at compile\n        // time. In particular, std::filesystem is unavailable before macOS 10.15, iOS/tvOS 13.0,\n        // and watchOS 6.0.\n        #ifdef __APPLE__\n            #include \u003cAvailability.h\u003e\n            // Note: This intentionally uses std::filesystem on any new Apple OS, like visionOS\n            // released after std::filesystem, where std::filesystem is always available.\n            // (All other __\u003cplatform\u003e_VERSION_MIN_REQUIREDs will be undefined and thus 0.)\n            #if __MAC_OS_X_VERSION_MIN_REQUIRED \u0026\u0026 __MAC_OS_X_VERSION_MIN_REQUIRED \u003c 101500 \\\n             || __IPHONE_OS_VERSION_MIN_REQUIRED \u0026\u0026 __IPHONE_OS_VERSION_MIN_REQUIRED \u003c 130000 \\\n             || __TV_OS_VERSION_MIN_REQUIRED \u0026\u0026 __TV_OS_VERSION_MIN_REQUIRED \u003c 130000 \\\n             || __WATCH_OS_VERSION_MAX_ALLOWED \u0026\u0026 __WATCH_OS_VERSION_MAX_ALLOWED \u003c 60000\n                #undef GHC_USE_STD_FS\n            #endif  \n        #endif\n    #endif\n#endif\n\n#ifdef GHC_USE_STD_FS\n    #include \u003cfilesystem\u003e\n    namespace fs {\n        using namespace std::filesystem;\n        using ifstream = std::ifstream;\n        using ofstream = std::ofstream;\n        using fstream = std::fstream;\n    }\n#else\n    #include \"fs_fwd.hpp\"\n    namespace fs {\n        using namespace ghc::filesystem;\n        using ifstream = ghc::filesystem::ifstream;\n        using ofstream = ghc::filesystem::ofstream;\n        using fstream = ghc::filesystem::fstream;\n    }\n#endif\n```\n\nand in the implementation hiding cpp, you might use (before any include that includes `ghc/fs_fwd.hpp`\nto take precedence:\n\n```cpp\n#if _MSVC_LANG \u003e= 201703L || __cplusplus \u003e= 201703L \u0026\u0026 defined(__has_include)\n    // ^ Supports MSVC prior to 15.7 without setting /Zc:__cplusplus to fix __cplusplus\n    // _MSVC_LANG works regardless. But without the switch, the compiler always reported 199711L: https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/\n    #if __has_include(\u003cfilesystem\u003e) // Two stage __has_include needed for MSVC 2015 and per https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005finclude.html\n        #define GHC_USE_STD_FS\n\n        // Old Apple OSs don't support std::filesystem, though the header is available at compile\n        // time. In particular, std::filesystem is unavailable before macOS 10.15, iOS/tvOS 13.0,\n        // and watchOS 6.0.\n        #ifdef __APPLE__\n            #include \u003cAvailability.h\u003e\n            // Note: This intentionally uses std::filesystem on any new Apple OS, like visionOS\n            // released after std::filesystem, where std::filesystem is always available.\n            // (All other __\u003cplatform\u003e_VERSION_MIN_REQUIREDs will be undefined and thus 0.)\n            #if __MAC_OS_X_VERSION_MIN_REQUIRED \u0026\u0026 __MAC_OS_X_VERSION_MIN_REQUIRED \u003c 101500 \\\n             || __IPHONE_OS_VERSION_MIN_REQUIRED \u0026\u0026 __IPHONE_OS_VERSION_MIN_REQUIRED \u003c 130000 \\\n             || __TV_OS_VERSION_MIN_REQUIRED \u0026\u0026 __TV_OS_VERSION_MIN_REQUIRED \u003c 130000 \\\n             || __WATCH_OS_VERSION_MAX_ALLOWED \u0026\u0026 __WATCH_OS_VERSION_MAX_ALLOWED \u003c 60000\n                #undef GHC_USE_STD_FS\n            #endif  \n        #endif\n    #endif\n#endif\n\n#ifndef GHC_USE_STD_FS\n    #include \"fs_impl.hpp\"\n#endif\n```\n\n:information_source: **Hint:** There are additional helper headers, named `ghc/fs_std_fwd.hpp` and\n`ghc/fs_std_impl.hpp` that use this technique, so you can simply include them\nif you want to dynamically select the filesystem implementation.\n\n\n\n### Git Submodule and CMake\n\nStarting from v1.1.0, it is possible to add `ghc::filesystem`\nas a git submodule, add the directory to your `CMakeLists.txt` with\n`add_subdirectory()` and then simply use `target_link_libraries(your-target ghc_filesystem)`\nto ensure correct include path that allow `#include \u003cghc/filesystem.hpp\u003e`\nto work.\n\nThe `CMakeLists.txt` offers a few options to customize its behavior:\n\n* `GHC_FILESYSTEM_BUILD_TESTING` - Compile tests, default is `OFF` when used as\n  a submodule, else `ON`.\n* `GHC_FILESYSTEM_BUILD_EXAMPLES` - Compile the examples, default is `OFF` when used as\n  a submodule, else `ON`.\n* `GHC_FILESYSTEM_WITH_INSTALL` - Add install target to build, default is `OFF` when used as\n  a submodule, else `ON`.\n* `GHC_FILESYSTEM_BUILD_STD_TESTING` -  Compile `std_filesystem_test`, the variant of\n  the test suite running against `std::filesystem`, defaulting to `GHC_FILESYSTEM_BUILD_TESTING`.\n  This is only done if the compiler is detected as being able to do it.\n* `GHC_FILESYSTEM_TEST_COMPILE_FEATURES` can be set to a list of features to override\n  `CMAKE_CXX_COMPILE_FEATURES` when the detection of C++17 or C++20 for additional tests\n  is not working (e.g. `cxx_std_20` to enforce building a `filesystem_test_cpp20` with C++20).\n\n### Bazel\n\nPlease use [hedronvision/bazel-cc-filesystem-backport](https://github.com/hedronvision/bazel-cc-filesystem-backport), which will automatically set everything up for you.\n\n### Versioning\n\nThere is a version macro `GHC_FILESYSTEM_VERSION` defined in case future changes\nmight make it needed to react on the version, but I don't plan to break anything.\nIt's the version as decimal number `(major * 10000 + minor * 100 + patch)`.\n\n:information_source: **Note:** Only even patch versions will be used for releases\nand odd patch version will only be used for in between commits while working on\nthe next version.\n\n\n## Documentation\n\nThere is almost no documentation in this release, as any `std::filesystem`\ndocumentation would work, besides the few differences explained in the next\nsection. So you might head over to https://en.cppreference.com/w/cpp/filesystem\nfor a description of the components of this library.\n\nWhen compiling with C++11, C++14 or C++17, the API is following the C++17\nstandard, where possible, with the exception that `std::string_view` parameters\nare only supported on C++17. When Compiling with C++20, `ghc::filesysytem`\ndefaults to the C++20 API, with the `char8_t` and `std::u8string` interfaces\nand the deprecated `fs::u8path` factory method.\n\n:information_source: **Note:** If the C++17 API should be enforced even in C++20 mode,\nuse the define `GHC_FILESYSTEM_ENFORCE_CPP17_API`.\nEven then it is possible to create `fws::path` from `std::u8string` but\n`fs::path::u8string()` and `fs::path::generic_u8string()` return normal\nUTF-8 encoded `std::string` instances, so code written for C++17 could\nstill work with `ghc::filesystem` when compiled with C++20.\n\nThe only additions to the standard are documented here:\n\n\n### `ghc::filesystem::ifstream`, `ghc::filesystem::ofstream`, `ghc::filesystem::fstream`\n\nThese are simple wrappers around `std::ifstream`, `std::ofstream` and `std::fstream`.\nThey simply add an `open()` method and a constructor with an `ghc::filesystem::path`\nargument as the `fstream` variants in C++17 have them.\n\n### `ghc::filesystem::u8arguments`\n\nThis is a helper class that currently checks for UTF-8 encoding on non-Windows platforms but on Windows it\nfetches the command line arguments as Unicode strings from the OS with\n\n```cpp\n::CommandLineToArgvW(::GetCommandLineW(), \u0026argc)\n```\n\nand then converts them to UTF-8, and replaces `argc` and `argv`. It is a guard-like\nclass that reverts its changes when going out of scope.\n\nSo basic usage is:\n\n```cpp\nnamespace fs = ghc::filesystem;\n\nint main(int argc, char* argv[])\n{\n    fs::u8arguments u8guard(argc, argv);\n    if(!u8guard.valid()) {\n        std::cerr \u003c\u003c \"Bad encoding, needs UTF-8.\" \u003c\u003c std::endl;\n        exit(EXIT_FAILURE);\n    }\n\n    // now use argc/argv as usual, they have utf-8 encoding on windows\n    // ...\n\n    return 0;\n}\n```\n\nThat way `argv` is UTF-8 encoded as long as the scope from `main` is valid.\n\n**Note:** On macOS, while debugging under Xcode the code currently will return\n`false` as Xcode starts the application with `US-ASCII` as encoding, no matter what\nencoding is actually used and even setting `LC_ALL` in the product scheme doesn't\nchange anything. I still need to investigate this.\n\n\n## Differences\n\nAs this implementation is based on existing code from my private helper\nclasses, it derived some constraints of it. Starting from v1.5.0 most of the\ndifferences between this and the standard C++17/C++20 API where removed.\n\n\n### LWG Defects\n\nThis implementation has switchable behavior for the LWG defects\n[#2682](https://wg21.cmeerw.net/lwg/issue2682),\n[#2935](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2935),\n[#2936](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2936) and\n[#2937](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2937).\nThe currently selected behavior (starting from v1.4.0) is following\n[#2682](https://wg21.cmeerw.net/lwg/issue2682), [#2936](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2936),\n[#2937](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2937) but\nnot following [#2935](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2935),\nas I feel it is a bug to report no error on a `create_directory()` or `create_directories()`\nwhere a regular file of the same name prohibits the creation of a directory and forces\nthe user of those functions to double-check via `fs::is_directory` if it really worked.\nThe more intuitive approach to directory creation of treating a file with that name as an\nerror is also advocated by the newer paper\n[WG21 P1164R0](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1164r0.pdf), the revision\nP1161R1 was agreed upon on Kona 2019 meeting [see merge](https://github.com/cplusplus/draft/issues/2703)\nand GCC by now switched to following its proposal\n([GCC #86910](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86910)).\n\n### Not Implemented on C++ before C++17\n\n```cpp\n// methods in ghc::filesystem::path:\npath\u0026 operator+=(basic_string_view\u003cvalue_type\u003e x);\nint compare(basic_string_view\u003cvalue_type\u003e s) const;\n```\n\nThese are not implemented under C++11 and C++14, as there is no\n`std::basic_string_view` available and I did want to keep this\nimplementation self-contained and not write a full C++17-upgrade for\nC++11/14. Starting with v1.1.0 these are supported when compiling\n`ghc::filesystem` under C++17 of C++20.\n\nStarting with v1.5.2 `ghc::filesystem` will try to allow the use of\n`std::experimental::basic_string_view` where it detects is availability.\nAdditionally if you have a `basic_string_view` compatible c++11\nimplementation it can be used instead of `std::basic_string_view`\nby defining `GHC_HAS_CUSTOM_STRING_VIEW` and importing the\nimplementation into the `ghc::filesystem` namespace with:\n\n```cpp\nnamespace ghc {\n    namespace filesystem {\n        using my::basic_string_view;\n    }\n}\n```\n\nbefore including the filesystem header.\n\n### Differences in API\n\nTo not depend on any external third party libraries and still stay portable and\ncompact, this implementation is following the [\"UTF-8 Everywhere\" philosophy](https://utf8everywhere.org/) in that all\n`std::string` instances will be interpreted the same as `std::u8string` encoding\nwise and as being in UTF-8. The `std::u16string` will be seen as UTF-16 and `std::u32string` will be\nseen as Unicode codepoints. Depending on the size of `std::wstring` characters, it will handle\n`std::wstring` as being UTF-16 (e.g. Windows) or `char32_t` Unicode codepoints\n(currently all other platforms).\n\n#### Differences of Specific Interfaces\n\nStarting with v1.5.0 `ghc::filesystem` is following the C++17 standard in\nusing `wchar_t` and `std::wstring` on Windows as the types internally used\nfor path representation. It is still possible to get the old behavior by defining\n`GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE` and get `filesystem::path::string_type` as\n`std::string` and `filesystem::path::value_type` as `wchar_t`.\n\nIf you need to call some Windows API, with v1.5.0 and above, simply\nuse the W-variant of the Windows-API call (e.g. `GetFileAttributesW(p.c_str())`).\n\n:information_source: **Note:** _When using the old behavior by defining\n`GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE`, use the `path::wstring()` member\n(e.g. `GetFileAttributesW(p.wstring().c_str())`). This gives you the\nUnicode variant independent of the `UNICODE` macro and makes sharing code\nbetween Windows, Linux and macOS easier and works with `std::filesystem` and\n`ghc::filesystem`._\n\n```cpp\nstd::string path::u8string() const;\nstd::string path::generic_u8string() const;\nvs.\nstd::u8string path::u8string() const;\nstd::u8string path::generic_u8string() const;\n```\n\nThe return type of these two methods is depending on the used C++ standard\nand if `GHC_FILESYSTEM_ENFORCE_CPP17_API` is defined. On C++11, C++14 and\nC++17 or when `GHC_FILESYSTEM_ENFORCE_CPP17_API` is defined, the return\ntype is `std::string`, and on C++20 without the define it is `std::u8string`.\n\n### Differences in Behavior\n\nI created a wiki entry about quite a lot of [behavioral differences](https://github.com/gulrak/filesystem/wiki/Differences-to-Standard-Filesystem-Implementations)\nbetween different `std::filesystem` implementations that could result in a\nmention here, but this readme only tries to address the design choice\ndifferences between `ghc::filesystem` and those. I try to update the wiki page\nfrom time to time.\n\nAny additional observations are welcome!\n\n#### fs.path ([ref](https://en.cppreference.com/w/cpp/filesystem/path))\n\nSince v1.5.0 the complete inner mechanics of this implementations `fs::path`\nwhere changed to the _native_ format as the internal representation.\nCreating any mixed slash `fs::path` object under Windows (e.g. with `\"C:\\foo/bar\"`)\nwill lead clean path with `\"C:\\foo\\bar\"` via `native()` and `\"C:/foo/bar\"` via\n`generic_string()` API. On all platforms redundant additional separators are\nremoved, even if this is not enforced by the standard and other implementations\nmostly not do this.\n\nAdditionally this implementation follows the standards suggestion to handle\nposix paths of the form `\"//host/path\"` and USC path on windows also as having\na root-name (e.g. `\"//host\"`). The GCC implementation didn't choose to do that\nwhile testing on Ubuntu 18.04 and macOS with GCC 8.1.0 or Clang 7.0.0. This difference\nwill show as warnings under `std::filesystem`. This leads to a change in the\nalgorithm described in the standard for `operator/=(path\u0026 p)` where any path\n`p` with `p.is_absolute()` will degrade to an assignment, while this implementation\nhas the exception where `*this == *this.root_name()` and `p == preferred_separator`\na normal append will be done, to allow:\n\n```cpp\nfs::path p1 = \"//host/foo/bar/file.txt\";\nfs::path p2;\nfor (auto p : p1) p2 /= p;\nASSERT(p1 == p2);\n```\n\nFor all non-host-leading paths the behavior will match the one described by\nthe standard.\n\n\n## Open Issues\n\n### Windows\n\n#### Symbolic Links on Windows\n\nAs symbolic links on Windows, while being supported more or less since\nWindows Vista (with some strict security constraints) and fully since some earlier\nbuild of Windows 10, when \"Developer Mode\" is activated, are at time of writing\n(2018) rarely used, still they are supported wiit th this implementation.\n\n#### Permissions\n\nThe Windows ACL permission feature translates badly to the POSIX permission\nbit mask used in the interface of C++17 filesystem. The permissions returned\nin the `file_status` are therefore currently synthesized for the `user`-level\nand copied to the `group`- and `other`-level. There is still some potential\nfor more interaction with the Windows permission system, but currently setting\nor reading permissions with this implementation will most certainly not lead\nto the expected behavior.\n\n\n## Release Notes\n\n### v1.5.15 (wip)\n\n* Fix for [#166](https://github.com/gulrak/filesystem/issues/166),\n  `extension()` did return non empty result for the directory name\n  `\"..\"`\n\n###  [v1.5.14](https://github.com/gulrak/filesystem/releases/tag/v1.5.14)\n\n* Pull request [#163](https://github.com/gulrak/filesystem/pull/163), build\n  support for Haiku (also fixes [#159](https://github.com/gulrak/filesystem/issues/159))\n* Pull request [#162](https://github.com/gulrak/filesystem/pull/162), fix for\n  directory iterator treating all files subsequent to a symlink as symlink\n  on Windows\n* Pull request [#161](https://github.com/gulrak/filesystem/pull/161), the\n  CMake alias `ghcFilesystem::ghc_filesystem` is now set unconditionally \n* Fix for [#160](https://github.com/gulrak/filesystem/issues/160), the cmake\n  config now only sets install targets by default if the project is no\n  subproject, as documented\n* Fix for [#157](https://github.com/gulrak/filesystem/issues/157), suppress\n  C4191 warning on MSVC for GetProcAddress casts\n* Fix for [#156](https://github.com/gulrak/filesystem/issues/156), on POSIX\n  `stem()`, `filename()` and `extension()` of `fs::path` would return wrong\n  result if a colon was in the filename\n* Pull request [#154](https://github.com/gulrak/filesystem/pull/145), build\n  support for GNU/Hurd\n* Pull request [#153](https://github.com/gulrak/filesystem/pull/153), fixed\n  `fs::last_write_time(path, time, ec)` setter on iOS, tvOS and watchOS\n* Fix for [#151](https://github.com/gulrak/filesystem/issues/156),\n  `fs::directory_entry::refresh()` now, consistently with `status()` will not\n  throw on symlinks to non-existing targets, but make the entry have\n  `file_type::not_found` as the type\n* Pull request [#149](https://github.com/gulrak/filesystem/pull/149), add\n  version to CMake project and export it\n* Fix for [#146](https://github.com/gulrak/filesystem/issues/146), handle `EINTR`\n  on POSIX directory iteration and file copy to avoid errors on network\n  filesystems \n* Pull request [#145](https://github.com/gulrak/filesystem/pull/145), fix for\n  Y2038 bug in timeToFILETIME on Windows\n* Pull request [#144](https://github.com/gulrak/filesystem/pull/144), `fs::copy_file()`\n  now also copies the permissions\n* Pull request [#143](https://github.com/gulrak/filesystem/pull/143), fix\n  for `fs::copy_file()` ignoring the `skip_existing` option.\n\n### [v1.5.12](https://github.com/gulrak/filesystem/releases/tag/v1.5.12)\n\n* Fix for [#142](https://github.com/gulrak/filesystem/issues/142), removed need\n  for `GHC_NO_DIRENT_D_TYPE` on systems that don't support `dirent::d_type` and\n  fixed build configuration and tests to support Solaris as new platform.\n* Pull request [#138](https://github.com/gulrak/filesystem/pull/138), if the\n  platform uses the POSIX backend and has no `PATH_MAX`, one is defined.\n* Pull request [#137](https://github.com/gulrak/filesystem/pull/137), update\n  of Catch2 to version v2.13.7\n* Added macOS 11 to the automatically tested platforms.\n\n### [v1.5.10](https://github.com/gulrak/filesystem/releases/tag/v1.5.10)\n\n* Pull request [#136](https://github.com/gulrak/filesystem/pull/136), the Windows\n  implementation used some unnecessary expensive shared pointer for resource\n  management and these where replaced by a dedicated code.\n* Fix for [#132](https://github.com/gulrak/filesystem/issues/132), pull request\n  [#135](https://github.com/gulrak/filesystem/pull/135), `fs::remove_all` now\n  just deletes symbolic links instead of following them.\n* Pull request [#133](https://github.com/gulrak/filesystem/pull/133), fix for\n  `fs::space` where a numerical overflow could happen in a multiplication.\n* Replaced _travis-ci.org_  with GitHub Workflow for the configurations:\n  Ubuntu 20.04: GCC 9.3, Ubuntu 18.04: GCC 7.5, GCC 8.4, macOS 10.15: Xcode 12.4,\n  Windows 10: Visual Studio 2019\n\n### [v1.5.8](https://github.com/gulrak/filesystem/releases/tag/v1.5.8)\n\n* Fix for [#125](https://github.com/gulrak/filesystem/issues/124), where\n  `fs::create_directories` on Windows no longer breaks on long filenames.\n\n### [v1.5.6](https://github.com/gulrak/filesystem/releases/tag/v1.5.6)\n\n* Fix for [#124](https://github.com/gulrak/filesystem/issues/124),\n  `ghc::filesystem` treated mounted folder/volumes erroneously as symlinks,\n  leading `fs::canonical` to fail on paths containing those.\n* Fix for [#122](https://github.com/gulrak/filesystem/issues/122), incrementing\n  the `recursive_directory_iterator` will not try to enter dead symlinks.\n* Fix for [#121](https://github.com/gulrak/filesystem/issues/121), on Windows\n  backend the `fs::remove` failed when the path pointed to a read-only entry,\n  see also ([microsoft/STL#1511](https://github.com/microsoft/STL/issues/1511))\n  for the corresponding issue in `std::fs` on windows.\n* Fix for [#119](https://github.com/gulrak/filesystem/issues/119), added missing\n  support for char16_t and char32_t and on C++20 char8_t literals.\n* Pull request [#118](https://github.com/gulrak/filesystem/pull/118), when\n  running tests as root, disable tests that would not work.\n* Pull request [#117](https://github.com/gulrak/filesystem/pull/117), added\n  checks to tests to detect the clang/libstdc++ combination.\n* Fix for [#116](https://github.com/gulrak/filesystem/issues/116), internal\n  macro `GHC_NO_DIRENT_D_TYPE` allows os detection to support systems without\n  the `dirent.d_type` member, experimental first QNX compile support as\n  initial use case, fixed issue with filesystems returning DT_UNKNOWN\n  (e.g. reiserfs).\n* Pull request [#115](https://github.com/gulrak/filesystem/pull/115), added\n  `string_view` support when clang with libstdc++ is detected.\n* Fix for [#114](https://github.com/gulrak/filesystem/issues/114), for macOS\n  the pre-Catalina deployment target detection worked only if `\u003cAvailability.h\u003e`\n  was included before `\u003cghc/fs_std.hpp\u003e` or `\u003cghc/fs_std_fwd.hpp\u003e`/`\u003cghc/fs_std_impl.hpp\u003e`.\n* Fix for [#113](https://github.com/gulrak/filesystem/issues/113), the use of\n  standard chapter numbers was misleading since C++17 and C++20 `std::filesystem`\n  features are supported, and was replaced by the tag-like chapter names that\n  stay (mostly) consistent over the versions.\n\n### [v1.5.4](https://github.com/gulrak/filesystem/releases/tag/v1.5.4)\n\n* Pull request [#112](https://github.com/gulrak/filesystem/pull/112), lots\n  of cleanup work on the readme, thanks!\n* Enhancement for [#111](https://github.com/gulrak/filesystem/issues/111),\n  further optimization of directory iteration, performance for\n  `recursive_directory_iterator` over large trees now somewhere  between\n  libc++ and libstdc++.\n* Enhancement for [#110](https://github.com/gulrak/filesystem/issues/110),\n  `ghc::filesystem` now has preliminary support for Cygwin. Changes where\n  made to allow the tests to compile and run successfully (tested with GCC\n  10.2.0), feedback and additional PRs welcome as it is currently not\n  part of the CI configuration.\n* Pull request [#109](https://github.com/gulrak/filesystem/pull/109), various\n  spelling errors in error messages and comments fixed.\n* Pull request [#108](https://github.com/gulrak/filesystem/pull/108), old\n  style casts removed.\n* Fix for [#107](https://github.com/gulrak/filesystem/issues/107), the error\n  handling for status calls was suppressing errors on symlink targets.\n* Pull request [#106](https://github.com/gulrak/filesystem/pull/106), fixed\n  detection of AppleClang for compile options.\n* Pull request [#105](https://github.com/gulrak/filesystem/pull/105), added\n  option `GHC_FILESYSTEM_BUILD_STD_TESTING` to override additional build of\n  `std::filesystem` versions of the tests for comparison and the possibility\n  to use `GHC_FILESYSTEM_TEST_COMPILE_FEATURES` to prefill the used compile\n  features defaulting to `CMAKE_CXX_COMPILE_FEATURES` when not given.\n\n### [v1.5.2](https://github.com/gulrak/filesystem/releases/tag/v1.5.2)\n\n* Enhancement [#104](https://github.com/gulrak/filesystem/issues/104),\n  on POSIX backend: optimized reuse of status information and reduced\n  `directory_entry` creation leads to about 20%-25% in tests with\n  `recursive_directory_iterator` over a larger directory tree.\n* Pull request [#103](https://github.com/gulrak/filesystem/pull/103), `wchar_t`\n  was not in the list of supported char types on non-Windows backends.\n* Pull request [#102](https://github.com/gulrak/filesystem/pull/102), improved\n  `string_view` support makes use of `\u003cstring_view\u003e` or `\u003cexperimental/string_view\u003e`\n  when available, and allows use of custom `basic_string_view` implementation\n  when defining `GHC_HAS_CUSTOM_STRING_VIEW` and importing the string view\n  into the `ghc::filesystem` namespace before including filesystem header.\n* Pull request [#101](https://github.com/gulrak/filesystem/pull/101), fix for\n  [#100](https://github.com/gulrak/filesystem/issues/100), append and concat\n  type of operations on path called redundant conversions.\n* Pull request [#98](https://github.com/gulrak/filesystem/pull/98), on older\n  linux variants (GCC 7/8), the comparison `std::filesystem` tests now link\n  with `-lrt` to avoid issues.\n* Fix for [#97](https://github.com/gulrak/filesystem/issues/97), on BTRFS the\n  test case for `fs::hard_link_count` failed due to the filesystems behavior,\n  the test case was adapted to take that into account.\n* Pull request [#96](https://github.com/gulrak/filesystem/pull/96), the export\n  attribute defines  `GHC_FS_API` and `GHC_FS_API_CLASS` are now honored when when\n  set from outside to allow override of behavior.\n* Fix for [#95](https://github.com/gulrak/filesystem/issues/95), the syntax for\n  disabling the deprecated warning in tests in MSVC was wrong.\n* Pull request [#93](https://github.com/gulrak/filesystem/pull/93), now the\n  CMake configuration file is configured and part of the `make install` files.\n\n### [v1.5.0](https://github.com/gulrak/filesystem/releases/tag/v1.5.0)\n\n* Fix for [#91](https://github.com/gulrak/filesystem/issues/91), the way\n  the CMake build options `GHC_FILESYSTEM_BUILD_TESTING`, `GHC_FILESYSTEM_BUILD_EXAMPLES`\n  and `GHC_FILESYSTEM_WITH_INSTALL` where implemented, prohibited setting them\n  from a parent project when using this via `add_subdirectory`, this fix\n  allows to set them again.\n* Major refactoring for [#90](https://github.com/gulrak/filesystem/issues/90),\n  the way, the Windows version of `fs::path` was originally created from the\n  POSIX based implementation was, by adaption of the incoming and outgoing\n  strings. This resulted in a mutable cache inside `fs::path`on Windows, that\n  was inherently not thread-safe, even for `const` methods.\n  To not add additional patches to a suboptimal solution, this time I reworked\n  the `path` code to now store _native_ path-representation. This changed a\n  lot of code, but when combined with `wchar_t` as `value_type` helped to avoid\n  lots of conversion for calls to Win-API.\u003cbr\u003e\n  As interfaces where changed, it had to be released in a new minor version.\n  The set of refactorings resulted in the following changes:\n  * `fs::path::native()` and `fs::path::c_str()` can now be `noexcept` as the\n    standard mandates\n  * On Windows `wchar_t` is now the default for `fs::path::value_type` and\n    `std::wstring` is the default for `fs::path::string_type`.\n  * This allows the implementation to call Win-API without allocating\n    conversions\n  * Thread-safety on `const` methods of `fs::path` is no longer an issue\n  * Some code could be simplified during this refactoring\n  * Automatic prefixing of long path on Windows can now be disabled with\n    defining `GHC_WIN_DISABLE_AUTO_PREFIXES`, for all other types of prefixes\n    or namespaces the behavior follows that of MSVC `std::filesystem::path`\n  * In case the old `char`/`std::string` based approach for Windows is still\n    needed, it can be activated with `GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE`\n* Enhancement for [#89](https://github.com/gulrak/filesystem/issues/89), `fs::file_status`\n  now supports `operator==` introduced in `std::filesystem` with C++20.\n* Refactoring for [#88](https://github.com/gulrak/filesystem/issues/88), `fs::path::parent_path()`\n  had a performance issue, as it was still using a loop based approach to recreate\n  the parent from elements. This created lots of temporaries and was too slow\n  especially on long paths.\n\n### [v1.4.0](https://github.com/gulrak/filesystem/releases/tag/v1.4.0)\n\n* Enhancements for [#71](https://github.com/gulrak/filesystem/issues/71), when compiled with C++20:\n  * `char8_t` and `std::u8string` are supported where `Source` is the parameter type\n  * `fs::path::u8string()` and `fs::path::generic_u8string()` now return a `std::u8string`\n  * The _spaceship operator_ `\u003c=\u003e` is now supported for `fs::path`\n  * With the define `GHC_FILESYSTEM_ENFORCE_CPP17_API` `ghc::filesystem` will fall back\n    to the old `fs::path::u8string()` and `fs::path::generic_u8string()` API if preferred\n* Bugfix for `fs::proximate(p, ec)` where the internal call to `fs::current_path()` was not\n  using the `error_code` variant, throwing possible exceptions instead of setting `ec`.\n* Enhancement `LWG_2936_BEHAVIOUR` is now on by default.\n* Some cleanup work to reduce preprocessor directives for better readability and remove unneeded\n  template specializations.\n\n### [v1.3.10](https://github.com/gulrak/filesystem/releases/tag/v1.3.10)\n\n* Fix for [#81](https://github.com/gulrak/filesystem/issues/81), fixed issues with\n  handling `Source` parameters that are string views.\n* Fix for [#79](https://github.com/gulrak/filesystem/issues/79), the bit operations\n  for filesystem bitmasks that should be are now `constexpr`.\n\n### [v1.3.8](https://github.com/gulrak/filesystem/releases/tag/v1.3.8)\n\n* Refactoring for [#78](https://github.com/gulrak/filesystem/issues/78), the dynamic\n  switching helper includes are now using `__MAC_OS_X_VERSION_MIN_REQUIRED` to\n  ensure that `std::filesystem` is only selected on macOS if the deployment target is\n  at least Catalina.\n* Bugfix for [#77](https://github.com/gulrak/filesystem/issues/77), the `directory_iterator`\n  and the `recursive_directory_iterator` had an issue with the `skip_permission_denied`\n  option, that leads to the inability to skip SIP protected folders on macOS.\n* Enhancement for [#76](https://github.com/gulrak/filesystem/issues/76), `_MSVC_LANG` is\n  now used when available, additionally to `__cplusplus`, in the helping headers to\n  allow them to work even when `/Zc:__cplusplus` is not used.\n* Bugfix for [#75](https://github.com/gulrak/filesystem/issues/75), NTFS reparse points\n  to mapped volumes where handled incorrect, leading to `false` on `fs::exists` or\n  not-found-errors on `fs::status`. Namespaced paths are not filtered anymore.\n\n### [v1.3.6](https://github.com/gulrak/filesystem/releases/tag/v1.3.6)\n\n* Pull request [#74](https://github.com/gulrak/filesystem/pull/74), on Windows symlink\n  evaluation used the wrong reparse struct information and was not handling the case\n  of relative paths well, thanks for the contribution.\n* Refactoring for [#73](https://github.com/gulrak/filesystem/issues/73), enhanced performance\n  in path handling. the changes lead to much fewer path/string creations or copies, speeding\n  up large directory iteration or operations on many path instances.\n* Bugfix for [#72](https://github.com/gulrak/filesystem/issues/72), the `TestAllocator` in\n  `filesystem_test.cpp` was completed to fulfill the requirements to build on CentOS 7 with\n  `devtoolset-9`. CentOS 7 and CentOS 8 are now part of the CI builds.\n* Bugfix for [#70](https://github.com/gulrak/filesystem/issues/70), root names are now case\n  insensitive on Windows. This fix also adds the new behavior switch `LWG_2936_BEHAVIOUR`\n  that allows to enable post C++17 `fs::path::compare` behavior, where the comparison is as\n  if it was an element wise path comparison as described in\n  [LWG 2936](https://cplusplus.github.io/LWG/issue2936) and C++20 `[fs.path.compare]`.\n  It is default off in v1.3.6 and will be default starting from v1.4.0 as it changes ordering.\n\n### [v1.3.4](https://github.com/gulrak/filesystem/releases/tag/v1.3.4)\n\n* Pull request [#69](https://github.com/gulrak/filesystem/pull/69), use `wchar_t` versions of\n  `std::fstream` from `ghc::filesystem::fstream` wrappers on Windows if using GCC with libc++.\n* Bugfix for [#68](https://github.com/gulrak/filesystem/issues/68), better handling of\n  permission issues for directory iterators when using `fs::directory_options::skip_permission_denied`\n  and initial support for compilation with emscripten.\n* Refactoring for [#66](https://github.com/gulrak/filesystem/issues/63), unneeded shared_ptr guards\n  where removed and the file handles closed where needed to avoid unnecessary allocations.\n* Bugfix for [#63](https://github.com/gulrak/filesystem/issues/63), fixed issues on Windows\n  with clang++ and C++17.\n* Pull request [#62](https://github.com/gulrak/filesystem/pull/62), various fixes for\n  better Android support, thanks for the PR\n* Pull request [#61](https://github.com/gulrak/filesystem/pull/61), `ghc::filesystem` now\n  supports use in projects with disabled exceptions. API signatures using exceptions for\n  error handling are not available in this mode, thanks for the PR (this resolves\n  [#60](https://github.com/gulrak/filesystem/issues/60) and\n  [#43](https://github.com/gulrak/filesystem/issues/43))\n\n### [v1.3.2](https://github.com/gulrak/filesystem/releases/tag/v1.3.2)\n\n* Bugfix for [#58](https://github.com/gulrak/filesystem/issues/58), on MinGW the\n  compilation could fail with an error about an undefined `ERROR_FILE_TOO_LARGE`\n  constant.\n* Bugfix for [#56](https://github.com/gulrak/filesystem/issues/58), `fs::lexically_relative`\n  didn't ignore trailing slash on the base parameter, thanks for PR\n  [#57](https://github.com/gulrak/filesystem/pull/57).\n* Bugfix for [#55](https://github.com/gulrak/filesystem/issues/55), `fs::create_directories`\n  returned `true` when nothing needed to be created, because the directory already existed.\n* Bugfix for [#54](https://github.com/gulrak/filesystem/issues/54), `error_code`\n  was not reset, if cached result was returned.\n* Pull request [#53](https://github.com/gulrak/filesystem/pull/53), fix for wrong\n  handling of leading whitespace when reading `fs::path` from a stream.\n* Pull request [#52](https://github.com/gulrak/filesystem/pull/52), an ARM Linux\n  target is now part of the CI infrastructure with the service of Drone CI.\n* Pull request [#51](https://github.com/gulrak/filesystem/pull/51), FreeBSD is now\n  part of the CI infrastructure with the service of Cirrus CI.\n* Pull request [#50](https://github.com/gulrak/filesystem/pull/50), adaptive cast to\n  `timespec` fields to avoid warnings.\n\n### [v1.3.0](https://github.com/gulrak/filesystem/releases/tag/v1.3.0)\n\n* **Important: `ghc::filesystem` is re-licensed from BSD-3-Clause to MIT license.** (see\n  [#47](https://github.com/gulrak/filesystem/issues/47))\n* Pull request [#46](https://github.com/gulrak/filesystem/pull/46), suppresses\n  unused parameter warning on Android.\n* Bugfix for [#44](https://github.com/gulrak/filesystem/issues/44), fixes\n  for warnings from newer Xcode versions.\n\n### [v1.2.10](https://github.com/gulrak/filesystem/releases/tag/v1.2.10)\n\n* The Visual Studio 2019 compiler, GCC 9.2 and Clang 9.0 where added to the\n  CI configuration.\n* Bugfix for [#41](https://github.com/gulrak/filesystem/issues/41), `fs::rename`\n  on Windows didn't replace an existing regular file as required by the standard,\n  but gave an error. New tests and a fix as provided in the issue was implemented.\n* Bugfix for [#39](https://github.com/gulrak/filesystem/issues/39), for the\n  forwarding use via `fs_fwd.hpp` or `fs_std_fwd.hpp` there was a use of\n  `DWORD` in the forwarding part leading to an error if `Windows.h` was not\n  included before the header. The tests were changed to give an error in that\n  case too and the useage of `DWORD` was removed.\n* Bugfix for [#38](https://github.com/gulrak/filesystem/issues/38), casting the\n  return value of `GetProcAddress` gave a warning with `-Wcast-function-type`\n  on MSYS2 and MinGW GCC 9 builds.\n\n### [v1.2.8](https://github.com/gulrak/filesystem/releases/tag/v1.2.8)\n\n* Pull request [#30](https://github.com/gulrak/filesystem/pull/30), the\n  `CMakeLists.txt` will automatically exclude building examples and tests when\n  used as submodule, the configuration options now use a prefixed name to\n  reduce risk of conflicts.\n* Pull request [#24](https://github.com/gulrak/filesystem/pull/24), install\n  target now creates a `ghcFilesystemConfig.cmake` in\n  `${CMAKE_INSTALL_LIBDIR}/cmake/ghcFilesystem` for `find_package` that\n  exports a target as `ghcFilesystem::ghc_filesystem`.\n* Pull request [#31](https://github.com/gulrak/filesystem/pull/31), fixes\n  `error: redundant redeclaration of 'constexpr' static data member` deprecation\n  warning in C++17 mode.\n* Pull request [#32](https://github.com/gulrak/filesystem/pull/32), fixes\n  old-style-cast warnings.\n* Pull request [#34](https://github.com/gulrak/filesystem/pull/34), fixes\n  [TOCTOU](https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use) situation\n  on `fs::create_directories`, thanks for the PR!\n* Feature [#35](https://github.com/gulrak/filesystem/issues/35), new CMake\n  option to add an install target `GHC_FILESYSTEM_WITH_INSTALL` that is\n  defaulted to OFF if `ghc::filesystem` is used via `add_subdirectory`.\n* Bugfix for [#33](https://github.com/gulrak/filesystem/issues/33), fixes\n  an issue with `fs::path::lexically_normal()` that leaves a trailing separator\n  in case of a resulting path ending with `..` as last element.\n* Bugfix for [#36](https://github.com/gulrak/filesystem/issues/36), warnings\n  on Xcode 11.2 due to unhelpful references in path element iteration.\n\n### [v1.2.6](https://github.com/gulrak/filesystem/releases/tag/v1.2.6)\n\n* Pull request [#23](https://github.com/gulrak/filesystem/pull/23), tests and\n  examples can now be disabled in CMake via setting `BUILD_TESTING` and\n  `BUILD_EXAMPLES` to `NO`, `OFF` or `FALSE`.\n* Pull request [#25](https://github.com/gulrak/filesystem/pull/25),\n  missing specialization for construction from `std::string_view` when\n  available was added.\n* Additional test case when `std::string_view` is available.\n* Bugfix for [#27](https://github.com/gulrak/filesystem/issues/27), the\n  `fs::path::preferred_separator` declaration was not compiling on pre\n  C++17 compilers and no test accessed it, to show the problem. Fixed\n  it to an construction C++11 compiler should accept and added a test that\n  is successful on all combinations tested.\n* Bugfix for [#29](https://github.com/gulrak/filesystem/issues/29), stricter\n  warning settings where chosen and resulting warnings where fixed.\n\n### [v1.2.4](https://github.com/gulrak/filesystem/releases/tag/v1.2.4)\n\n* Enabled stronger warning switches and resulting fixed issues on GCC and MinGW\n* Bugfix for #22, the `fs::copy_options` where not forwarded from `fs::copy` to\n  `fs::copy_file` in one of the cases.\n\n### [v1.2.2](https://github.com/gulrak/filesystem/releases/tag/v1.2.2)\n\n* Fix for ([#21](https://github.com/gulrak/filesystem/pull/21)), when compiling\n  on Alpine Linux with musl instead of glibc, the wrong `strerror_r` signature\n  was expected. The complex preprocessor define mix was dropped in favor of\n  the usual dispatch by overloading a unifying wrapper.\n\n### [v1.2.0](https://github.com/gulrak/filesystem/releases/tag/v1.2.0)\n\n* Added MinGW 32/64 and Visual Studio 2015 builds to the CI configuration.\n* Fixed additional compilation issues on MinGW.\n* Pull request ([#13](https://github.com/gulrak/filesystem/pull/13)), set\n  minimum required CMake version to 3.7.2 (as in Debian 8).\n* Pull request ([#14](https://github.com/gulrak/filesystem/pull/14)), added\n  support for a make install target.\n* Bugfix for ([#15](https://github.com/gulrak/filesystem/issues/15)), the\n  forward/impl way of using `ghc::filesystem` missed a `\u003cvector\u003e` include\n  in the windows case.\n* Bugfix for ([#16](https://github.com/gulrak/filesystem/issues/16)),\n  VS2019 didn't like the old size dispatching in the utf8 decoder, so it\n  was changed to a sfinae based approach.\n* New feature ([#17](https://github.com/gulrak/filesystem/issues/17)), optional\n  support for standard conforming `wchar_t/std::wstring` interface when\n  compiling on Windows with defined `GHC_WIN_WSTRING_STRING_TYPE`, this is\n  default when using the `ghc/fs_std*.hpp` header, to enhance compatibility.\n* New feature ([#18](https://github.com/gulrak/filesystem/issues/18)), optional\n  filesystem exceptions/errors on Unicode errors with defined\n  `GHC_RAISE_UNICODE_ERRORS` (instead of replacing invalid code points or\n  UTF-8 encoding errors with the replacement character `U+FFFD`).\n* Pull request ([#20](https://github.com/gulrak/filesystem/pull/20)), fix for\n  file handle leak in `fs::copy_file`.\n* Coverage now checked in CI (~95% line coverage).\n\n### [v1.1.4](https://github.com/gulrak/filesystem/releases/tag/v1.1.4)\n\n* Additional Bugfix for ([#12](https://github.com/gulrak/filesystem/issues/12)),\n  error in old unified `readdir/readdir_r` code of `fs::directory_iterator`;\n  as `readdir_r` is now deprecated, I decided to drop it and the resulting\n  code is much easier, shorter and due to more refactoring faster\n* Fix for crashing unit tests against MSVC C++17 `std::filesystem`\n* Travis-CI now additionally test with Xcode 10.2 on macOS\n* Some minor refactorings\n\n### [v1.1.2](https://github.com/gulrak/filesystem/releases/tag/v1.1.2)\n\n* Bugfix for ([#11](https://github.com/gulrak/filesystem/issues/11)),\n  `fs::path::lexically_normal()` had some issues with `\"..\"`-sequences.\n* Bugfix for ([#12](https://github.com/gulrak/filesystem/issues/12)),\n  `fs::recursive_directory_iterator` could run into endless loops,\n  the methods depth() and pop() had issues and the copy behavior and\n  `input_iterator_tag` conformance was broken, added tests\n* Restructured some CMake code into a macro to ease the support for\n  C++17 `std::filesystem` builds of tests and examples for interoperability\n  checks.\n* Some fixes on Windows tests to ease interoperability test runs.\n* Reduced noise on `fs::weakly_canonical()` tests against `std::fs`\n* Added simple `du` example showing the `recursive_directory_iterator`\n  used to add the sizes of files in a directory tree.\n* Added error checking in `fs::file_time_type` test helpers\n* `fs::copy()` now conforms LWG #2682, disallowing the use of\n  `copy_option::create_symlinks' to be used on directories\n\n### [v1.1.0](https://github.com/gulrak/filesystem/releases/tag/v1.1.0)\n\n* Restructuring of the project directory. The header files are now using\n  `hpp` as extension to be marked as c++ and they where moved to\n  `include/ghc/` to be able to include by `\u003cghc/filesystem.hpp\u003e` as the\n  former include name might have been to generic and conflict with other\n  files.\n* Better CMake support: `ghc::filesystem` now can be used as a submodul\n  and added with `add_subdirectory` and will export itself as `ghc_filesystem`\n  target. To use it, only `target_link_libraries(your-target ghc_filesystem)`\n  is needed and the include directories will be set so `#include \u003cghc/filesystem.hpp\u003e`\n  will be a valid directive.\n  Still you can simply only add the header file to you project and include it\n  from there.\n* Enhancement ([#10](https://github.com/gulrak/filesystem/issues/10)),\n  support for separation of implementation and forwarded api: Two\n  additional simple includes are added, that can be used to forward\n  `ghc::filesystem` declarations (`fs_fwd.hpp`) and to wrap the\n  implementation into a single cpp (`fs_impl.hpp`)\n* The `std::basic_string_view` variants of the `fs::path` api are\n  now supported when compiling with C++17.\n* Added CI integration for Travis-CI and Appveyor.\n* Fixed MinGW compilation issues.\n* Added long filename support for Windows.\n\n### [v1.0.10](https://github.com/gulrak/filesystem/releases/tag/v1.0.10)\n\n* Bugfix for ([#9](https://github.com/gulrak/filesystem/issues/9)), added\n  missing return statement to `ghc::filesystem::path::generic_string()`\n* Added checks to hopefully better compile against Android NDK. There where\n  no tests run yet, so feedback is needed to actually call this supported.\n* `filesystem.h` was renamed `filesystem.hpp` to better reflect that it is\n  a c++ language header.\n\n### [v1.0.8](https://github.com/gulrak/filesystem/releases/tag/v1.0.8)\n\n* Bugfix for ([#6](https://github.com/gulrak/filesystem/issues/6)), where\n  `ghc::filesystem::remove()` and `ghc::filesystem::remove_all()` both are\n  now able to remove a single file and both will not raise an error if the\n  path doesn't exist.\n* Merged pull request ([#7](https://github.com/gulrak/filesystem/pull/7)),\n  a typo leading to setting error code instead of comparing it in\n  `ghc::filesystem::remove()` under Windows.\n* Bugfix for (([#8](https://github.com/gulrak/filesystem/issues/8)), the\n  Windows version of `ghc::filesystem::directory_iterator` now releases\n  resources when reaching `end()` like the POSIX one does.\n\n\n### [v1.0.6](https://github.com/gulrak/filesystem/releases/tag/v1.0.6)\n\n* Bugfix for ([#4](https://github.com/gulrak/filesystem/issues/4)), missing error_code\n  propagation in `ghc::filesystem::copy()` and `ghc::filesystem::remove_all` fixed.\n* Bugfix for ([#5](https://github.com/gulrak/filesystem/issues/5)), added missing std\n  namespace in `ghc::filesystem::recursive_directory_iterator::difference_type`.\n\n### [v1.0.4](https://github.com/gulrak/filesystem/releases/tag/v1.0.4)\n\n* Bugfix for ([#3](https://github.com/gulrak/filesystem/issues/3)), fixed missing inlines\n  and added test to ensure including into multiple implementation files works as expected.\n* Building tests with `-Wall -Wextra -Werror` and fixed resulting issues.\n\n### [v1.0.2](https://github.com/gulrak/filesystem/releases/tag/v1.0.2)\n\n* Updated catch2 to v2.4.0.\n* Refactored `fs.op.permissions` test to work with all tested `std::filesystem`\n  implementations (gcc, clang, msvc++).\n* Added helper class `ghc::filesystem::u8arguments` as `argv` converter, to\n  help follow the UTF-8 path on windows. Simply instantiate it with `argc` and\n  `argv` and it will fetch the Unicode version of the command line and convert\n  it to UTF-8. The destructor reverts the change.\n* Added `examples` folder with hopefully some usefull example usage. Examples are\n  tested (and build) with `ghc::filesystem` and C++17 `std::filesystem` when\n  available.\n* Starting with this version, only even patch level versions will be tagged and\n  odd patch levels mark in-between non-stable wip states.\n* Tests can now also be run against MS version of `std::filesystem` for comparison.\n* Added missing `fstream` include.\n* Removed non-conforming C99 `timespec`/`timeval` usage.\n* Fixed some integer type mismatches that could lead to warnings.\n* Fixed `chrono` conversion issues in test and example on clang 7.0.0.\n\n### [v1.0.1](https://github.com/gulrak/filesystem/releases/tag/v1.0.1)\n\n* Bugfix: `ghc::filesystem::canonical` now sees empty path as non-existant and reports\n  an error. Due to this `ghc::filesystem::weakly_canonical` now returns relative\n  paths for non-existant argument paths. ([#1](https://github.com/gulrak/filesystem/issues/1))\n* Bugfix: `ghc::filesystem::remove_all` now also counts directories removed ([#2](https://github.com/gulrak/filesystem/issues/2))\n* Bugfix: `recursive_directory_iterator` tests didn't respect equality domain issues\n  and dereferencapable constraints, leading to fails on `std::filesystem` tests.\n* Bugfix: Some `noexcept` tagged methods and functions could indirectly throw exceptions\n  due to UFT-8 decoding issues.\n* `std_filesystem_test` is now also generated if LLVM/clang 7.0.0 is found.\n\n\n### [v1.0.0](https://github.com/gulrak/filesystem/releases/tag/v1.0.0)\n\nThis was the first public release version. It implements the full range of\nC++17 `std::filesystem`, as far as possible without other C++17 dependencies.\n\n","funding_links":[],"categories":["HarmonyOS","C++","File System"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgulrak%2Ffilesystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgulrak%2Ffilesystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgulrak%2Ffilesystem/lists"}