354 Commits

Author SHA1 Message Date
Andrey Semashev 5d3082b4d4 Use a better highlight for the new feature in release notes. 2020-05-08 19:13:11 +03:00
Andrey Semashev dea37d899e Added support for copy_options::skip_existing. 2020-05-08 19:09:39 +03:00
Andrey Semashev 9182b4caa3 Added copy_file implementations based on sendfile and copy_file_range on Linux.
This may improve file copying performance.
2020-05-05 20:31:41 +03:00
Andrey Semashev f199152b7d Refactored copy_file, added copy_options, deprecated copy_option.
The copy_file operation implementation has been inlined into the
detail::copy_file function. The part that copies the file body has been
extracted to a separate function, so that addition of specialized copy
implementations later is possible.

Added copy_options enum, which reflects the enum from C++20. Currently,
only overwrite_existing option is supported. Other options will be added
later.

The old enum copy_option is deprecated in favor of copy_options.

Updated docs to reflect recent changes to copy_file behavior.
2020-05-05 18:34:20 +03:00
Andrey Semashev fcbdae1581 Added temp_directory_path implementation for Windows CE. Refactor POSIX version.
The Windows CE implementation is based on the code proposed in
https://github.com/boostorg/filesystem/pull/25, updated and corrected.

Closes https://github.com/boostorg/filesystem/pull/25.
2020-05-05 01:54:35 +03:00
Andrey Semashev a26ead7402 Updated space() behavior to match C++20. Add support for file paths on Windows.
space() now initializes space_info members to -1 values, which is used when the
structure is returned in case of error.

On Windows, check if the path refers to a directory, and use the parent
directory if not. In order to make sure we return space information for the
target filesystem, we have to resolve symlinks in this case.

Fixes https://github.com/boostorg/filesystem/issues/73.
2020-05-05 01:14:00 +03:00
Andrey Semashev 726d2bfa35 Specify file sharing flags in read_symlink on Windows.
This fixes potential sharing violation errors when the same file
is opened concurrently by read_symlink and someone else.

Fixes https://github.com/boostorg/filesystem/issues/138.
2020-05-03 20:29:19 +03:00
Andrey Semashev eedaa1f565 Set S_IWUSR perm on the file created by copy_file and copy source perms on completion.
This ensures that the files overwritten or created by copy_file have the same
permission bits as the source file, as required by C++20. Also, for the duration
of the copy operation we ensure the target file has writing permission set.
This is important e.g. for NFS, which checks the permission on the server,
so a writable file descriptor on the client is not enough for the write
operation to succeed.

Notably, this doesn't save the case of overwriting the file with no write
permission set. In this case the operation will fail with EPERM.

Also, use fsync/fdatasync to guarantee that the target file is written
completely without errors before closing the file descriptor.
2020-05-03 19:43:55 +03:00
Andrey Semashev 1f06d4f064 Added release notes for the fixes in canonical, read_symlink and equivalent. 2020-05-02 21:41:15 +03:00
Andrey Semashev a5fc1faf28 Add source and target file checks to copy_file, simplify file equivalence checks
The POSIX copy_file implementation has beed reworked to perform checks for
whether the source and target files are regilar files and whether the source
and target paths identify the same file. Also, the implementation has been fixed
to report the correct error code from the failed operation to the caller
in case of failure. The implementation is now also protected against EINTR
errors and uses O_CLOEXEC when possible to avoid leaking file descriptors
if the caller process forks.

Also, the file equivalence test is now simplified to not test the file size
and last modification time. These tests had a potential of causing a false
negative, if the file that is being tested was modified between the stat()
calls that were used to obtain file information from the paths.

Closes https://github.com/boostorg/filesystem/pull/48.
2020-05-01 20:09:37 +03:00
Andrey Semashev 79e8d844f5 Added a release note about removing compile-time checks for symlinks and hardlinks on Windows. 2020-05-01 20:09:37 +03:00
Glen Fernandes aaf54ada48 Fix link to use Boost ML archive instead of GMANE 2020-04-09 08:23:40 -04:00
Andrey Semashev 93f0c76869 Added a note about moving filesystem_error implementation to the compiled library. 2019-10-26 01:06:44 +03:00
Andrey Semashev e4de1c4138 Removed "new" content markup, HTML fixes, added lexically_proximate docs. 2019-10-05 23:18:30 +03:00
Andrey Semashev 06d8d660a1 Fixed path::lexically_relative to handle empty, dot and dot-dot elements.
The algorithm implementation now ignores empty and dot path elements in the
argument path and accounts dot-dot elements by decreasing the number of
dot-dot elements to generate in the resulting relative path. This is
according to C++17 std::path specification [fs.path.gen]/4.

Fixes https://github.com/boostorg/filesystem/issues/76.
2019-10-05 19:14:21 +03:00
Andrey Semashev 03c797998f Added directory_options::skip_dangling_symlinks.
The new option allows to skip dangling directory symlinks when iterating
over a directory using recursive_directory_iterator.

This also updates the operations_test, which failed spuriously because
the test created dangling symlinks for some of its checks. Since the order
of iteration is undefined, the tests sometimes passed, when the dangling
symlinks were encountered late during the iteration.
2019-08-20 19:02:56 +03:00
Andrey Semashev 9a14c37d6f Added directory_options. Set recursive_dir_iterator to end or pop on errors.
The directory_options enum reflects the same-named enum from C++20. It is now
supported by both directory_iterator and recursive_directory_iterator. In
particular, both iterators now support skip_permission_denied option.

recursive_directory_iterator is now set to end by default on errors, as
required by C++20. An additional directory_options::pop_on_error policy
is added to allow the iterator recover from an error. When this option is
specified and an error occurs, the iterator repeatedly pops the recursion level
until the pop completes successfully or the end state is reached.

recursive_directory_iterator that have standard counterparts (level,
no_push_pending, no_push_request and no_push) are now deprecated and can be
removed by defining BOOST_FILESYSTEM_NO_DEPRECATED. These members will be
removed in a future release.

Docs and tests updated accordingly. Also, in docs reconstructed release history
for the past releases from Boost release notes.

Fixes https://github.com/boostorg/filesystem/issues/112
Fixes https://github.com/boostorg/filesystem/issues/113
2019-08-02 19:43:46 +03:00
Andrey Semashev 27256f9d55 Removed asynch-exceptions=on for MSVC. 2019-01-14 20:46:59 +03:00
Andrey Semashev c0c93a0c58 Removed linking with Boost.System from docs and examples. 2019-01-14 20:40:06 +03:00
Andrey Semashev 613df5a93d Merge pull request #38 from jwilk-forks/spelling
Fix typos in documentation
2018-11-24 20:17:54 +03:00
Andrey Semashev fe0e264cf6 Merge pull request #46 from programmerjake/develop
fix ISO9660 Joliet name and remove extraneous character
2018-11-24 19:57:14 +03:00
Beman 49218481e5 Clean up some tutorial example code and fix the wording for it in the tutorial. Thanks to Anmol-Singh-Jaggi for pull request #11. 2017-08-07 20:01:08 -04:00
Jacob Lifshay 9f926b83d9 fix ISO9660 Joliet name 2017-06-26 21:10:06 -07:00
Jacob Lifshay e7d2e325f9 remove extraneous character in #name_check_functions 2017-06-26 21:07:46 -07:00
Beman 7fd4214912 is_empty()overload with error_code parameter should not throw on error. Thanks to ldqrk for pull request #42 2017-04-03 09:36:43 -04:00
Beman 9144a8ebd7 Update release history. 2017-04-03 08:29:00 -04:00
Beman 4ccb6c38f2 Start release history for 1.64 2016-12-30 14:52:52 -05:00
Jakub Wilk 97cb638138 Fix typos in documentation. 2016-12-07 12:54:33 +01:00
Beman 93429f24a1 Update release_history.html for pull request #31. 2016-11-26 14:27:33 -05:00
Beman Dawes fca046d0c4 Merge pull request #31 from faithandbrave/patch-1
fix docs for signature stem(), extension() member functions
2016-11-26 14:18:26 -05:00
Beman 4e4374336c Fix #7307, remove_all(dirname,ec) throws on write protected directories. This is a tough one to test. There are three internal function calls where errors might arise, and it would take too much time to write tests for each of those cases. Someday we will have Titus Winter's mock installable file system, but for now are relying on code inspection rather than testing. 2016-11-23 12:02:09 -05:00
Beman e34b838041 Document a couple of pull requests. 2016-11-23 10:51:47 -05:00
Beman Dawes 51e51fc735 Merge pull request #34 from tbeu/tbeu-patch-1
Fix link text in reference.
2016-11-23 10:39:57 -05:00
Beman 216720de55 Fix #12495, create_directories() crashes when passed empty string as path, from Samantha Ritter. Also affected create_directory(). Charles Olivi submitted a pull request with some particularly helpful test cases. 2016-11-23 09:58:43 -05:00
Beman 5004d7b177 Fix #12578 - Bug in directory_iterator, recursive_directory_iterator, equality testing of copied iterator also at end. 2016-11-23 09:21:32 -05:00
Beman a3c1014b21 Tweak release history. 2016-11-23 05:33:53 -05:00
Beman 48faf2b1ee Add deprecated path::generic() 2016-11-22 16:51:45 -05:00
Rene Rivera c8f1b16989 Add, and update, documentation build targets. 2016-10-07 23:07:33 -05:00
tbeu ce0be4bfe7 Fix link text 2016-09-13 14:01:19 +02:00
Akira Takahashi 0027b3ef53 fix signature stem(), extension() member functions
`stem()` and `extension()` member functions doesn't have parameter.
2016-07-07 15:55:34 +09:00
Beman 2f6391b931 Add class path constexpr constants separator and dot of the type appropriate for the platform, and add class path member query functions filename_is_dot() and filename_is_dot_dot(). These add convenience and the implementations may be more efficient that user coded equivalent functions. Also add detail functions is_directory_separator() and is_element_separator(), and replace all uses of local is_separator() in path.cpp with detail::is_directory_separator(). 2015-12-01 10:17:45 -05:00
Beman 7b31aa0259 Fix typo in issue # and link (Daniel Krügler) 2015-11-21 08:06:49 -05:00
Beman 3c344a5f0b Revert to lexical functions back to being members of class path. This is not the time to redesign the library's lexical vs operational conventions. It would break existing users mental model of lexical vs operational.
See doc/relative_proposal.html#Add-lexical-functions for additional rationale.
2015-10-25 13:28:49 -04:00
Beman b0091c2eeb Revert to lexical functions being members of class path. This is not the time to redesign the library's lexical vs operational conventions. It would break existing users mental model of lexical vs operational. 2015-10-25 08:23:40 -04:00
Beman 8c179bf1df Add 1.58.0 BOOST_SCOPED_ENUM fix history 2015-10-25 05:47:45 -04:00
Beman 7e3e5ef60c Fix #11733, Missing unistd.h include in boost/libs/filesystem/src/unique_path.cpp by apply a patch from Idar Tollefsen. 2015-10-16 16:03:45 -04:00
Beman 06968ee032 Fix pull request 17, 'some_function() noexcept = default;' from Antony Polukhin, by never relying on "= default". Antony's pull request would have fixed the problem interaction with noexcept by eliminating the noexcept. I preferred to retain the noexcept rather than the "= default", as applying "= default" has been exceedingly troublesome for both VC++ and GCC due to interactions between the two C++11 features. GCC interactions varied not just for the version, but also for the platform. 2015-10-08 07:19:55 -04:00
Beman c3f9a2ec92 Correct some file names 2015-09-18 10:39:38 -04:00
Beman 865102a87a Initial commit 2015-09-18 07:49:00 -04:00
Beman a5ecdd44d2 Acknowledge minor fixes. 2015-09-17 07:50:28 -04:00