429 Commits

Author SHA1 Message Date
Andrey Semashev
a916a41602
Merge pull request #102 from stima/develop
Correct handling status of reparse point
2020-05-06 14:59:59 +03:00
Roman Savchenko
ed9e019b01 Add test for reparse point that is not symlink 2020-05-06 13:37:28 +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
6be120a079 Fixed space test failure for files.
The test used to fail because the path to the file was empty.
2020-05-05 14:35:41 +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
ee6604657d Fix 99_canonical_with_junction_point test not removing temp directory.
The test used to swich the current directory inside the temp directory
structure, which prevented it from removing it on exit.
2020-05-04 23:04:11 +03:00
Andrey Semashev
89b5152e86 Fixed check for mklink on Windows.
For some unknown reason, Windows 8.1 system shell returns error code 1 when
invoking mklink to test if it exists. To work around this we now analyze
output of the command in the Jamfile. As an added bonus, the test is not
compiled when mklink is not supported.
2020-05-04 20:00:40 +03:00
Alexander Grund
37dd08caa5
Address review comments 2020-05-02 18:39:21 +02:00
Flamefire
ccb22fc517
Add test to trigger bug #99
Resolving junction points in read_symlink and canonical is wrong
2020-05-01 17:02:48 +02:00
Andrey Semashev
4642ac8e03 Nonessential code formatting cleanup. 2020-05-01 17:22:31 +03:00
Alexander Grund
1dd143e37d
Test for mklink existance before running junction tests 2020-04-25 16:03:52 +02:00
Andrey Semashev
0fcfd93407 Updated lightweight_test.hpp includes to the new location. 2020-03-04 00:49:27 +03:00
Andrey Semashev
b33598605c Updated deprecated uses of boost::bind to silence warnings. 2020-03-04 00:45:48 +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
33806dc726 Removed use of deprecated API. 2019-08-02 21:33:23 +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
c758552338 Moved directory tools to separate files. Reworked readdir_r support.
Directory iteration components were moved to separate files to simplify
maintenance of operations.hpp/cpp.

directory_iterator implementation on POSIX platforms has been reworked
to only allocate internal buffer when readdir_r is used. When readdir
is used, the dirent structure returned by readdir is used directly, which
eliminates the potential of buffer overrun in case if some directory name
exceeds the buffer size. This also removes the need to copy dirent members
into the buffer, which improves performance and simplifies maintenance.

For buffer size we now use the max path size as opposed to max filename
size. This is done to minimize the possibility of buffer overruns when
readdir_r is used.

On Windows, use Boost.WinAPI to configure the default target Windows version.
This removes WINVER and _WIN32_WINNT defines in Boost.Filesystem as these
macros should be defined by Boost.WinAPI now.

Additionally, exception.hpp and directory.hpp includes in operations.hpp are
marked as deprecated as operations.hpp do not need those components. Users
are encouraged to include the new headers explicitly in their code, as needed.
2019-08-01 20:34:39 +03:00
Nikita Kniazev
a5c4b21988
operations_test: Enable locale query on MinGW/Cygwin
The `GetUserDefaultUILanguage` is available for a quite long time already (about 19 years for Cygwin, and 7-12 years for MinGW).
2019-04-02 15:29:13 +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
2c1fa1a4a0 Removed linking with Boost.System.
Since Boost.System is now header-only, no need to depend on its library.

Fixes https://github.com/boostorg/filesystem/issues/98.
2019-01-14 20:08:41 +03:00
Andrey Semashev
a5dce21b60 Removed test log. 2018-12-09 01:30:50 +03:00
Andrey Semashev
8de281773f Added definitions for path static constants.
This fixes compilation if user's code attempts to ODR-use the constants.

Fixes https://svn.boost.org/trac10/ticket/12759.
Closes https://github.com/boostorg/filesystem/pull/40.
2018-11-24 20:34:44 +03:00
Andrey Semashev
5a70ced692 Reverted the previous change regarding warnings aboit slicing exceptions.
Apparently, slicing was intentional, and the test verified that it worked.
This commit restores the previous behavior and disables the gcc warning
instead.
2018-11-24 18:59:08 +03:00
Andrey Semashev
e268f557df Trim trailing spaces in the tests. 2018-11-24 15:23:43 +03:00
Andrey Semashev
d710f5d9d9 Fixed warnings about slicing exceptions and ignoring std::system result. 2018-11-24 15:21:19 +03:00
Peter Dimov
3ae9ac8e27 Add global visibility to libboost_filesystem as well 2018-09-26 08:29:28 +03:00
Peter Dimov
7ba4bfb949 Simplify test/Jamfile 2018-09-26 06:05:17 +03:00
Peter Dimov
68909064bd Disable hidden visibility under UBSan for the codecvt-using tests 2018-09-26 05:58:36 +03:00
Peter Dimov
0837d92982 poison_category() was undefined behavior, use a normal one 2018-09-26 01:34:19 +03:00
Peter Dimov
9ed5b9e31d Fix test to better tolerate parallel execution 2018-09-06 07:00:41 +03:00
Peter Dimov
a183553454 Add a test for the fs::copy issue in PR #70/#71 2018-09-05 22:24:09 +03:00
Peter Dimov
f13aa18a93 Fix BOOST_FOREACH support; add test 2018-09-05 07:59:20 +03:00
Beman
cd6fead714 Upgrade MSVC Platform Toolset to 141. 2018-04-10 07:56:37 -04:00
Beman
4bd92f00bb Initial commit of Beman's Windows b2 test script 2018-04-10 07:52:04 -04:00
Peter Dimov
d8a6730d6e Do not return a reference to NULL in poison_category(), to make the test pass on clang with variant=release 2018-01-29 19:29:53 +02:00
Peter Dimov
9a9bf767fb Fix tests to better tolerate parallel execution 2017-12-19 02:44:43 +02:00
Peter Dimov
589bfb0436 Add quick test target (for CI) 2017-12-02 17:59:21 +02:00
Peter Dimov
1290dfa1dc Add #include <boost/next_prior.hpp>; no longer in utility.hpp 2017-12-02 03:59:46 +02:00
Peter Dimov
669d35d8db Merge branch 'feature/fix-op-unit-test' into feature/fix-cygwin-op-test 2017-11-22 17:34:13 +02:00
Peter Dimov
03eb5df380 Use SetEnvironmentVariableW on Cygwin too 2017-11-22 16:15:26 +02:00
Peter Dimov
1dc51988bb Make operations_unit_test take a current directory argument; pass one in test/Jamfile 2017-11-22 05:05:43 +02:00
Beman
07619fb370 Add Beman's local test results to aid tracking changes over time. 2017-08-24 08:00:38 -04: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
Beman
170f483655 Add test/config_info.cpp to increase macro state reporting in hopes of easing debugging on remote machines. 2017-01-08 15:23:42 -05:00
Beman
4ccb6c38f2 Start release history for 1.64 2016-12-30 14:52:52 -05:00
Beman
2550f407f4 MinGW defines __MINGW32__ rather than _MSC_VER, so also test for __MINGW32__ to see if setenv/unsetenv workaround needed. 2016-12-30 10:09:31 -05:00
Beman
163631cc7d ticket #12574 was just user confusion, but are the tests are worth keeping. 2016-11-28 08:29:08 -05:00
Beman
15c7706111 Fix create directory testing boo boo; Turns out " " is a valid file and directory name on Linux (and I'm guessing other POSIX-like systems). Add a POSIX-only test; "/foo" was reported to cause a crash on an earlier version. Don't test this on Windows since a user may well have sufficient permissions to create a directory in root. 2016-11-24 14:34:00 -05:00