Commit Graph

232 Commits

Author SHA1 Message Date
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
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
74c5f5fe3e Fix a forward declaration that was missed in a prior pull request. This clears a GCC warning. 2015-10-08 07:04:13 -04:00
Beman
5610f974be Merge branch 'feature/relative2' into develop 2015-09-04 15:24:22 -04:00
Beman
011522bd42 Fix #7258, create_directories returns false if the path ends with a slash. Also fix related issues if path contains dot or dot-dot elements, and add test cases to the test suite. 2015-09-02 08:24:41 -04:00
Beman
a2d4f99cc8 Resolve #11166 by mitigating (i.e. reducing the likelihood of) a possible external file system race in remove(), using a slight refinement of the patch supplied by Jeff Epler. Made no attempt to fix or mitigate the thread data race in the test program provided. 2015-09-01 11:34:24 -04:00
Beman
f6aa067256 Minor code and comment tweaks. 2015-08-31 10:23:41 -04:00
Beman
2b019a8483 Fix #11288 A patch to avoid redundant string allocations 2015-08-30 16:44:27 -04:00
Beman
810f40becf Add a quote from the standard 2015-08-30 16:33:39 -04:00
Beman
efe50fad52 Work issue, but no fix yet 2015-08-30 16:32:44 -04:00
Beman
90517e4596 Fix #11447, __OpenBSD__ macro name misspelled, by applying a patch submitted by Jasper Lievisse Adriaanse. 2015-08-29 10:13:36 -04:00
Beman
5e5b529dc2 Fix #10591, boost::filesystem does not build on iOS 8, by applying a patch submitted by Daniel Seither. 2015-08-28 16:41:13 -04:00
Sebastian Redl
26b24ed329 Fix a race condition in unique_path.
If two threads call unique_path at the same time for the first time in the program run,
both initial calls to CryptAcquireContext can fail. Both threads will then call the function
with CRYPT_NEWKEYSET, but only one of these threads can succeed. The other will
fail with NTE_EXISTS.

This patch makes it so that if a call fails with that error, it will try to call without the
flag one more time, in case another thread created the key set in the meantime.

This also applies the patch from trac report #7506. Using these additional flags
is the right thing to do.
2015-08-27 11:42:56 +02:00
Beman
732609a2da Change member normal() and relative() to non-member lexically_normal() and lexically_relative(). See doc/relative_proposal.html#Add-lexical-functions-as-non-members for rationale. 2015-08-23 09:33:21 -04:00
Beman
c739cee694 Apply normal() to weakly_canonical results, but only when know to be needed or it is not known if it may be needed. 2015-08-19 08:43:36 -04:00
Beman
cb11081a7d Finish initial proposed wording section of relative_proposal.html. Drive-by tweaks to other stuff. Add example/directory_symlink_parent_resolution.cpp, include/boost/filesystem/string_file.hpp, and related infrastructure. 2015-08-12 17:26:03 -04:00
Beman
a7ac4c088f Add relative_test to Jamfile, fix Cygwin/GCC C++03 enum constant usage error. 2015-08-10 08:09:48 -04:00
Beman
7d6429554a Bring operational functions weakly_canonical() and relative() up to production quality: move implementations to operations.cpp, add error handling, replace tail recursion with iteration, rename weak_canonical to weakly_canonical. The weak_canonical name grated on me every type I used it. 2015-08-10 07:10:59 -04:00
Beman
34dd2c7718 Add a new path member function: "path normal() const;" and change the old deprecated normalize() non-const function to be implemented in terms of the new function. The implementation remains the same, except for returning by value rather than modifying in place. Motivation: Jamie Alsop has identified removal of redundant .. and . elements (i.e. normalization) as a need closely related to the relative path functionality requested by numerous Boost issue requests, the C++ LWG, and NB comments to the Filesystem TS. Given that both lexical and operational relative functionality is needed, there is less risk in providing a well-documented path::normal() lexical function. 2015-08-08 16:29:44 -04:00
Beman
9706dbb9b1 Revert "Change the name of path::relative to path::relative_to to distinguish it a bit from path::relative_path."
This reverts commit d5fb8323f8.

Leave possible renaming for bikeshed discussions. KISS.
2015-08-08 05:44:30 -04:00
Beman
d5fb8323f8 Change the name of path::relative to path::relative_to to distinguish it a bit from path::relative_path. 2015-08-07 16:50:47 -04:00
Beman
6da5f657fb Remove lexically_relative() free function. Add path::rel 2015-08-07 16:41:06 -04:00
Beman
dc794ea95b Merge branch 'feature/relative' into feature/relative2 2015-08-06 08:08:46 -04:00
Beman
95175ef819 Fix #11491, temp_directory_path doesn't return valid temp path on Android. 2015-07-22 11:13:06 -04:00
Adrien Destugues
3a02e54625 haiku: don't crash because of unsupported locale in libstdc++
See https://svn.boost.org/trac/boost/ticket/4688
We do the same as on Mac OS X and assume the filesystem uses utf-8.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2015-03-17 22:26:31 +00:00
Beman
424f09019c Rewrite Windows implementation of temp_directory_path() to (1) avoid GetTempPath() failure if path length > 130 (ticket #5300) and (2) provide a more sensible sequence of directories than provided by GetTempPath(), per boost list discussion "[filesystem] temp_directory_path() behavior on Windows". 2015-02-03 11:31:57 -05:00
Beman
06bddf3bc3 Rename typedef causing conflict with cygwin libraries. Fix refactoring missed in create_directory_symlink() that only affected cygwin tests. Clear gcc warning on cygwin tests. 2015-01-31 08:53:02 -05:00
Beman
01bbe99241 Refactor operations error handling helpers to (1) be less confusing and (2) fix a Windows problem where ::SetLastError() values were getting cleared before they could be retrieved by the error handling helpers. 2015-01-31 08:00:59 -05:00
Beman
c0b5754ab8 Fix ticket #10388, an occasional failure of temp_directory_path to deal correctly with the trailing separator. A path member function remove_trailing_separator() was added publicly since this may be useful to users. 2015-01-10 09:31:44 -05:00
Beman
bb5a0ff09d Clear warnings, including new warnings from VC++ 2015 preview. 2015-01-05 10:34:24 -05:00
Beman
e4e5bb8bf5 Fix ticket #6945 by applying patch from Kaylyn Bogle 2014-12-30 10:48:46 -05:00
Beman
704f4e328d Add a comment, and two BOOST_ASSERTs to detect the possible infinite loop described in ticket 4438 in case my analysis that the infinite loop will never happen is wrong. 2014-12-26 10:07:43 -05:00
Beman
4b4b3d8853 Add support for the Wind River VxWorks RTOS. Thanks to Rogerio Dos Santos. 2014-12-04 07:23:21 -05:00
Beman
490c2c3298 For all path_traits convert() and dispatch() functions provide two overloads, one with a "const codecvt_type&" argument, and one without. The overload without a codecvt argument calls path::codecvt() iff a conversion actually needs to be performed. Change all uses of path_traits convert() and dispatch() functions call the appropriate overload, rather than calling with path::codecvt() as a default. This limits the impact of locale("") initialization failures on Linux and other non-BSD POSIX systems to programs that actually depend on locale(""). It further ensures that exceptions thrown as a result of such failures occur after main() has started, and so can be caught. 2014-10-27 19:20:17 -04:00
Beman
1262a9f0d2 Fix C++03 compile failures for previous commit. 2014-10-24 11:46:50 -04:00
Beman
d57509c558 For compiled operational function detail::copy_file, pass detail::copy_options, a plain-old enum, rather than a BOOST_SCOPED_ENUM. We cannot pass a BOOST_SCOPED_ENUM to a compled function because it will result in an undefined reference if the library is compiled with -std=c++0x but the use is compiled in C++03 mode, or vise versa. Fixes tickets #6124, #6779, and #10038. 2014-10-24 10:58:42 -04:00
Beman
d5a2658d16 Move constant used only on Windows into Windows-specific helpers. Quiets clang warning message. 2014-09-04 09:24:20 -04:00
Beman
0041ea9646 Removed unused codecvt buffer size definitions long since moved to path_traits. Quiets clang warning. 2014-09-04 09:13:57 -04:00
Beman
76d209567f Refactor dot_path and dot_dot_path into functions, to prevent path constructor being called before main() starts. In theory that is harmless when path::value_type is the same as value_type of the ctor Source, but eliminating it simplifies reasoning about program correctness. 2014-08-22 11:31:42 -04:00
Beman
5b4e1b5580 Remove comments about mutexes. They are a distraction and less relevant as C++11 support becomes widespread. 2014-08-18 09:01:16 -04:00
Beman
35096ca056 Add 9219.cpp plus infrastructure and path.cpp logging 2014-08-17 10:55:01 -04:00
Beman
8ef629c906 Add __OpenBSD__ to the operating systems that "expect their string parameters to be in UTF-8 encoding and nothing else." Fixes #8352 2014-08-06 12:24:44 -04:00
Beman
750a82e20d Revert "Merge branch 'develop' of github.com:boostorg/filesystem into develop"
This reverts commit 4610afc49e, reversing
changes made to 6623bde4fe.
2014-08-05 09:16:57 -04:00
Beman
cc99cc6ceb Merge branch 'develop' into ts-develop 2014-07-31 17:24:34 -04:00
Beman
d83b8d9c6b Add ticket number. 2014-07-28 17:05:43 -04:00
Beman
91c4517a8c Add a useless initialization to quiet the Clang static analyzer, closing ticket #8954. 2014-07-28 16:47:25 -04:00
Beman
feffecb67f Remove testing residue, update copyright date. 2014-07-25 15:35:36 -04:00
Beman
d774842f39 Initial directory junction support. See release_history.html 2014-07-25 11:00:54 -04:00
Beman
038bce7e2d DTS: enum perms changed to enum class perms. Constant names have changed; synonyms provided. 2014-07-23 15:35:44 -04:00
Beman
99a94662b2 Merge branch 'develop' into ts-develop
Conflicts:
	include/boost/filesystem/operations.hpp
	test/operations_test.cpp
2014-07-22 20:55:58 -04:00