filesystem

An implementation of C++17 std::filesystem for C++11 /C++14/C++17/C++20 on Windows, macOS, Linux and FreeBSD.

MIT License

Stars
1.3K
Committers
40

Bot releases are visible (Hide)

filesystem - ghc::filesystem Release v1.5.14 Latest Release

Published by gulrak over 1 year ago

Changes:

  • Pull request #163, build support for Haiku (also fixes #159)
  • Pull request #162, fix for directory iterator treating all files subsequent to a symlink as symlink on Windows
  • Pull request #161, the CMake alias ghcFilesystem::ghc_filesystem is now set unconditionally
  • Fix for #160, the cmake config now only sets install targets by default if the project is no subproject, as documented
  • Fix for #157, suppress C4191 warning on MSVC for GetProcAddress casts
  • Fix for #156, on POSIX stem(), filename() and extension() of fs::path would return wrong result if a colon was in the filename
  • Pull request #154, build support for GNU/Hurd
  • Pull request #153, fixed fs::last_write_time(path, time, ec) setter on iOS, tvOS and watchOS
  • Fix for #151, fs::directory_entry::refresh() now, consistently with status() will not throw on symlinks to non-existing targets, but make the entry have file_type::not_found as the type
  • Pull request #149, add version to CMake project and export it
  • Fix for #146, handle EINTR on POSIX directory iteration and file copy to avoid errors on network filesystems
  • Pull request #145, fix for Y2038 bug in timeToFILETIME on Windows
  • Pull request #144, fs::copy_file() now also copies the permissions
  • Pull request #143, fix for fs::copy_file() ignoring the skip_existing option.

Thank you to all the reporters of issues and contributors of PRs!

filesystem - ghc::filesystem Release v1.5.12

Published by gulrak over 2 years ago

Changes:

  • Fix for #142, removed need for GHC_NO_DIRENT_D_TYPE on systems that don't support dirent::d_type and fixed build configuration and tests to support Solaris as new platform.
  • Pull request #138, if the platform uses the POSIX backend and has no PATH_MAX, one is defined.
  • Pull request #137, update of Catch2 to version v2.13.7
  • Added macOS 11 to the automatically tested platforms.
filesystem - ghc::filesystem Release v1.5.10

Published by gulrak almost 3 years ago

Changes:

  • Pull request #136, the Windows implementation used some unnecessary expensive shared pointer for resource management and these where replaced by a dedicated code.
  • Fix for #132, pull request #135, fs::remove_all now just deletes symbolic links instead of following them.
  • Pull request #133, fix for fs::space where a numerical overflow could happen in a multiplication.
  • Replaced travis-ci.org with GitHub Workflow for the configurations: Ubuntu 20.04: GCC 9.3, Ubuntu 18.04: GCC 7.5, GCC 8.4, macOS 10.15: Xcode 12.4, Windows 10: Visual Studio 2019
filesystem - ghc::filesystem Release v1.5.8

Published by gulrak over 3 years ago

Changes:

  • Fix for #125, where fs::create_directories on Windows no longer breaks on long filenames.
filesystem - ghc::filesystem Release v1.5.6

Published by gulrak over 3 years ago

Changes:

  • Fix for #124, ghc::filesystem treated mounted folder/volumes erroneously as symlinks, leading fs::canonical to fail on paths containing those.
  • Fix for #122, incrementing the recursive_directory_iterator will not try to enter dead symlinks.
  • Fix for #121, on Windows backend the fs::remove failed when the path pointed to a read-only entry, see also (microsoft/STL#1511) for the corresponding issue in std::fs on windows.
  • Fix for #119, added missing support for char16_t and char32_t and on C++20 char8_t literals.
  • Pull request #118, when running tests as root, disable tests that would not work.
  • Pull request #117, added checks to tests to detect the clang/libstdc++ combination.
  • Fix for #116, internal macro GHC_NO_DIRENT_D_TYPE allows os detection to support systems without the dirent.d_type member, experimental first QNX compile support as initial use case, fixed issue with filesystems returning DT_UNKNOWN (e.g. reiserfs).
  • Pull request #115, added string_view support when clang with libstdc++ is detected.
  • Fix for #114, for macOS the pre-Catalina deployment target detection worked only if <Availability.h> was included before <ghc/fs_std.hpp> or <ghc/fs_std_fwd.hpp>/<ghc/fs_std_impl.hpp>.
  • Fix for #113, the use of standard chapter numbers was misleading since C++17 and C++20 std::filesystem features are supported, and was replaced by the tag-like chapter names that stay (mostly) consistent over the versions.
filesystem - ghc::filesystem Release v1.5.4

Published by gulrak over 3 years ago

Changes

  • Pull request #112, lots of cleanup work on the readme, thanks!
  • Enhancement for #111, further optimization of directory iteration, performance for recursive_directory_iterator over large trees now somewhere between libc++ and libstdc++.
  • Enhancement for #110, ghc::filesystem now has preliminary support for Cygwin. Changes where made to allow the tests to compile and run successfully (tested with GCC
    10.2.0), feedback and additional PRs welcome as it is currently not part of the CI configuration.
  • Pull request #109, various spelling errors in error messages and comments fixed.
  • Pull request #108, old style casts removed.
  • Fix for #107, the error handling for status calls was suppressing errors on symlink targets.
  • Pull request #106, fixed detection of AppleClang for compile options.
  • Pull request #105, added option GHC_FILESYSTEM_BUILD_STD_TESTING to override additional build of std::filesystem versions of the tests for comparison and the possibility to use GHC_FILESYSTEM_TEST_COMPILE_FEATURES to prefill the used compile features defaulting to CMAKE_CXX_COMPILE_FEATURES when not given.
filesystem - ghc::filesystem Release v1.5.2

Published by gulrak over 3 years ago

Changes

  • Enhancement #104, on POSIX backend: optimized reuse of status information and reduced directory_entry creation leads to about 20%-25% in tests with recursive_directory_iterator over a larger directory tree.
  • Pull request #103, wchar_t was not in the list of supported char types on non-Windows backends.
  • Pull request #102, improved string_view support makes use of <string_view> or <experiemental/string_view> when available, and allows use of custom basic_string_view implementation when defining GHC_HAS_CUSTOM_STRING_VIEW and importing the string view into the ghc::filesystem namespace before including filesystem header.
  • Pull request #101, fix for #100, append and concat type of operations on path called redundant conversions.
  • Pull request #98, on older linux variants (GCC 7/8), the comerative std::filesystem tests now link with -lrt to avoid issues.
  • Fix for #97, on BTRFS the test case for fs::hard_link_count failed due to the filesystems behavior, the test case was adapted to take that into account.
  • Pull request #96, the export attribute defines GHC_FS_API and GHC_FS_API_CLASS are now honored when when set from outside to allow override of behavior.
  • Fix for #95, the syntax for disabling the deprecated warning in tests in MSVC was wrong.
  • Pull request #93, now the CMake configuration file is configured and part of the make install files.
filesystem - ghc::filesystem Release v1.5.0

Published by gulrak over 3 years ago

Changes:

  • Fix for #91, the way the CMake build options GHC_FILESYSTEM_BUILD_TESTING, GHC_FILESYSTEM_BUILD_EXAMPLES and GHC_FILESYSTEM_WITH_INSTALL where implemented, prohibited setting them from a parent project when using this via add_subdirectory, this fix allows to set them again.
  • Major refactoring for #90, the way, the Windows version of fs::path was originally created from the POSIX based implementation was, by adaption of the incoming and outgoing strings. This resulted in a mutable cache inside fs::pathon Windows, that was inherently not thread-safe, even for const methods.
    To not add additional patches to a suboptimal solution, this time I reworked the path code to now store native path-representation. This changed a lot of code, but when combined with wchar_t as value_type helped to avoid lots of conversion for calls to Win-API.
    As interfaces where changed, it had to be released in a new minor version. The set of refactorings resulted in the following changes:
    • fs::path::native() and fs::path::c_str() can now be noexcept as the standard mandates
    • On Windows wchar_t is now the default for fs::path::value_type and std::wstring is the default für fs::path::string_type.
    • This allows the implementation to call Win-API without allocating conversions
    • Thread-safety on const methods of fs::path is no longer an issue
    • Some code could be simplified during this refactoring
    • Automatic prefixing of long path on Windows can now be disabled with defining GHC_WIN_DISABLE_AUTO_PREFIXES, for all other types of prefixes or namespaces the behavior follows that of MSVC std::filesystem::path
    • In case the old char/std::string based approach for Windows is still needed, it can be activated with GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE
  • Enhancement for #89, fs::file_status now supports operator== introduced in std::filesystem with C++20.
  • Refactoring for #88, fs::path::parent_path() had a performance issue, as it was still using a loop based approach to recreate the parent from elements. This created lots of temporaries and was too slow especially on long paths.
filesystem - ghc::filesystem Release v1.4.0

Published by gulrak almost 4 years ago

Changes:

  • Enhancements for #71, when compiled with C++20:
    • char8_t and std::u8string are supported where Source is the parameter type
    • fs::path::u8string() and fs::path::generic_u8string() now return a std::u8string
    • The spaceship operator <=> is now supported for fs::path
    • With the define GHC_FILESYSTEM_ENFORCE_CPP17_API ghc::filesystem will fall back to the old fs::path::u8string() and fs::path::generic_u8string() API if preferred
  • Bugfix for fs::proximate(p, ec) where the internal call to fs::current_path() was not using the error_code variant, throwing possible exceptions instead of setting ec.
  • Enhancement LWG_2936_BEHAVIOUR is now on by default.
  • Some cleanup work to reduce preprocessor directives for better readability and remove unneeded template specializations.
filesystem - ghc::filesystem Release v1.3.10

Published by gulrak almost 4 years ago

Changes:

  • Fix for #81, fixed issues with handling Source parameters that are string views.
  • Fix for #79, the bit operations for filesystem bitmasks that should be, are now constexpr.
filesystem - ghc::filesystem v1.3.8

Published by gulrak almost 4 years ago

Changes:

  • Refactoring for #78, the dynamic switching helper includes are now using __MAC_OS_X_VERSION_MIN_REQUIRED to ensure that std::filesystem is only selected on macOS if the deployment target is at least Catalina.
  • Bugfix for #77, the directory_iterator and the recursive_directory_iterator had an issue with the skip_permission_denied option, that leads to the inability to skip SIP protected folders on macOS.
  • Enhancement for #76, _MSVC_LANG is now used when available, additionally to __cplusplus, in the helping headers to allow them to work even when /Zc:__cplusplus is not used.
  • Bugfix for #75, NTFS reparse points to mapped volumes where handled incorrect, leading to false on fs::exists or not-found-errors on fs::status. Namespaced paths are not filtered anymore.
filesystem - ghc::filesystem v1.3.6

Published by gulrak about 4 years ago

Changes

  • Pull request #74, on Windows symlink evaluation used the wrong reparse struct information and was not handling the case of relative paths well, thanks for the contribution.
  • Refactoring for #73, enhanced performance in path handling. the changes lead to much fewer path/string creations or copies, speeding up large directory iteration or operations on many path instances.
  • Bugfix for #72, the TestAllocator in filesystem_test.cpp was completed to fulfill the requirements to build on CentOS 7 with devtoolset-9. CentOS 7 and CentOS 8 are now part of the CI builds.
  • Bugfix for #70, root names are now case insensitive on Windows. This fix also adds the new behaviour switch LWG_2936_BEHAVIOUR that allows to enable post C++17 fs::path::compare behaviour, where the comparison is as if it was an element wise path comparison as described in LWG 2936 and C++20 [fs.path.compare]. It is default off in v1.3.6 and will be default starting from v1.4.0 as it changes ordering.
filesystem - ghc::filesystem v1.3.4

Published by gulrak about 4 years ago

  • Pull request #69, use wchar_t versions of std::fstream from ghc::filesystem::fstream wrappers on Windows if using GCC with libc++.
  • Bugfix for #68, better handling of permission issues for directory iterators when using fs::directory_options::skip_permission_denied and initial support for compilation with emscripten.
  • Refactoring for #66, unneeded shared_ptr guards where removed and the file handles closed where needed to avoid unnecessary allocations.
  • Bugfix for #63, fixed issues on Windows with clang++ and C++17.
  • Pull request #62, various fixes for better Android support, thanks for the PR
  • Pull request #61, ghc::filesystem now supports use in projects with disabled exceptions. API signatures using exceptions for error handling are not available in this mode, thanks for the PR (this resolves #60 and #43)
filesystem - ghc::filesystem Release v1.3.2

Published by gulrak over 4 years ago

  • Bugfix for #58, on MinGW the compilation could fail with an error about an undefined ERROR_FILE_TOO_LARGE constant.
  • Bugfix for #56, fs::lexically_relative didn't ignore trailing slash on the base parameter, thanks for PR #57.
  • Bugfix for #55, fs::create_directories returned true when nothing needed to be created, because the directory already existed.
  • Bugfix for #54, error_code was not reset, if cached result was returned.
  • Pull request #53, fix for wrong handling of leading whitespace when reading fs::path from a stream.
  • Pull request #52, an ARM Linux target is now part of the CI infrastructure with the service of Drone CI.
  • Pull request #51, FreeBSD is now part of the CI infrastucture with the service of Cirrus CI.
  • Pull request #50, adaptive cast to timespec fields to avoid warnings.
  • Pull Request #49, additional GHC_OS_* target defines for BSD and SYS5R4 systems.
  • Pull request #48, typo fix.
filesystem - New License Release v1.3.0

Published by gulrak over 4 years ago

  • Important: ghc::filesystem is re-licensed from BSD-3-Clause to MIT license. (see #47)
  • Pull request #46, suppresses unused parameter warning on Android.
  • Bugfix for #44, fixes for warnings from newer Xcode versions.
filesystem - Bugfix Release v1.2.10

Published by gulrak almost 5 years ago

  • The Visual Studio 2019 compiler, GCC 9.2 and Clang 9.0 where added to the CI configuration.
  • Bugfix for #39, fs::rename on Windows didn't replace an axisting regular file as required by the standard, but gave an error. New tests and a fix as provided in the issue was implemented.
  • Bugfix for #39, for the forwarding use via fs_fwd.hpp or fs_std_fwd.hpp der was a use of DWORD in the forwarding part leading to an error if Windows.h was not
    included before the header. The tests were changed to give an error in that case too and the useage of DWORD was removed.
  • Bugfix for #38, casting the return value of GetProcAddress gave a warning with -Wcast-function-type on MSYS2 and MinGW GCC 9 builds.
filesystem - Bugfix Release v1.2.8

Published by gulrak almost 5 years ago

  • Pull request #30, the CMakeLists.txt will automatically exclude building examples and tests when used as submodule, the configuration options now use a prefixed name to
    reduce risk of conflicts.
  • Pull request #24, install target now creates a ghcFilesystemConfig.cmake in ${CMAKE_INSTALL_LIBDIR}/cmake/ghcFilesystem for find_package that
    exports a target as ghcFilesystem::ghc_filesystem.
  • Pull request #31, fixes error: redundant redeclaration of 'constexpr' static data member deprecation warning in C++17 mode.
  • Pull request #32, fixes old-style-cast warnings.
  • Pull request #34, fixes TOCTOU situation on fs::create_directories, thanks for the PR!
  • Feature #35, new CMake option to add an install target GHC_FILESYSTEM_WITH_INSTALL that is defaulted to OFF if ghc::filesystem is used via add_subdirectory.
  • Bugfix for #33, fixes an issue with fs::path::lexically_normal() that leaves a trailing separator in case of a resulting path ending with .. as last element.
  • Bugfix for #36, warings on Xcode 11.2 due to unhelpfull references in path element iteration.
filesystem - ghc::filesystem Release v1.2.6

Published by gulrak about 5 years ago

  • Pull request #23, tests and examples can now be disabled in CMake via setting BUILD_TESTING and BUILD_EXAMPLES to NO, OFF or FALSE.
  • Pull request #25, missing specialization for construction from std::string_view when available was added.
  • Additional test case when std::string_view is available.
  • Bugfix for #27, the fs::path::preferred_seperator declaration was not compiling on pre C++17 compilers and no test accessed it, to show the problem. Fixed it to an construction C++11 compiler should accept and added a test that is successful on all combinations tested.
  • Bugfix for #29, stricter warning settings where chosen and resulting warnings where fixed.
filesystem - ghc::filesystem Release v1.2.4

Published by gulrak about 5 years ago

  • Enabled stronger warning switches and resulting fixed issues on GCC and MinGW
  • Bugfix for #22, the fs::copy_options where not forwarded from fs::copy to fs::copy_file in one of the cases.
filesystem - ghc::filesystem Release v1.2.2

Published by gulrak over 5 years ago

  • Fix for (#21), when compiling on Alpine Linux with musl instead of glibc, the wrong strerror_r signature was expected. The complex preprocessor define mix was dropped in favor of the usual dispatch by overloading a unifying wrapper.
Package Rankings
Top 6.07% on Proxy.golang.org
Top 7.41% on Alpine-edge
Top 16.35% on Conda-forge.org
Top 37.07% on Anaconda.org
Badges
Extracted from project README
CMake Build Matrix Build Status Build Status Coverage Status Latest Release Tag