Boost logo

Boost :

Subject: Re: [boost] [filesystem] temp_dir_path()
From: Beman Dawes (bdawes_at_[hidden])
Date: 2010-10-16 11:44:07


On Thu, Oct 14, 2010 at 3:05 PM, Jeff Flinn
<TriumphSprint2000_at_[hidden]> wrote:
>
> I've attached an updated patch to ticket #4742.
>
> This adds tests to operations_test.cpp that test the error handling for both
> returned error code and thrown filesystem_error. Additionally it tests
> proper retrieval of the path from the list of env vars for each of the
> platforms.
>
> Also, temp_dir_path now also sets the error_code to ENOTDIR upon failure.
>
> These test pass on Windows XP with MSVC8 and Mac OSX10.5.8 with Xcode3.1.2
> using gcc 4.0.1
>
> I'd appreciate it if others could run the tests on other os/compilers as
> well.

First, thanks to Jeff for a nice piece of work!

For those of you who didn't actually look at his patch file, he
provided a working implementation, test code, and documentation. All
in the style of the current code, and fully integrated into the
library. A joy to work with.

I've applied the patch to my working copy, inspected the code and
documentation, and tested with the compilers on my Windows machine.
Here are my reactions:

* This is useful functionality and I'm planning to accept it into the
library. A few nits follow, but they are all trivial to fix.

* For consistency with the rest of the library, the name should be
"temp_directory_path" rather than "temp_dir_path".

* I'll do a bit of doc rewording to make them a bit less Windows and
POSIX centric.

* There are compilation failures (see below) with MinGW. I'm guessing
this is a minor configuration issue with the test code that will be
trivial to fix.

* And of course Jeff will be given credit for contributing this nice
addition to Boost.Filesystem.

Thanks,

--Beman

..\v3\test\operations_test.cpp: In function
'void<unnamed>::temp_dir_path_tests()':
..\v3\test\operations_test.cpp:1606:73: error: no matching function
for call to '<unnamed>::temp_dir_path_tests()::guarded_tmp_vars::guarded_tmp_vars(const
char*, int, int)'
..\v3\test\operations_test.cpp:1578:9: note: candidates are:
<unnamed>::temp_dir_path_tests()::guarded_tmp_vars::guarded_tmp_vars(const
boost::filesystem3::path::value_type*, const
boost::filesystem3::path::value_type*, const
boost::filesystem3::path::value_type*)
..\v3\test\operations_test.cpp:1573:7: note:
<unnamed>::temp_dir_path_tests()::guarded_tmp_vars::guarded_tmp_vars(const<unnamed>::temp_dir_path_tests()::guarded_tmp_vars&)
..\v3\test\operations_test.cpp:1611:73: error: no matching function
for call to '<unnamed>::temp_dir_path_tests()::guarded_tmp_vars::guarded_tmp_vars(int,
const char*, int)'
..\v3\test\operations_test.cpp:1578:9: note: candidates are:
<unnamed>::temp_dir_path_tests()::guarded_tmp_vars::guarded_tmp_vars(const
boost::filesystem3::path::value_type*, const
boost::filesystem3::path::value_type*, const
boost::filesystem3::path::value_type*)
..\v3\test\operations_test.cpp:1573:7: note:
<unnamed>::temp_dir_path_tests()::guarded_tmp_vars::guarded_tmp_vars(const<unnamed>::temp_dir_path_tests()::guarded_tmp_vars&)
..\v3\test\operations_test.cpp:1616:73: error: no matching function
for call to '<unnamed>::temp_dir_path_tests()::guarded_tmp_vars::guarded_tmp_vars(int,
int, const char*)'
..\v3\test\operations_test.cpp:1578:9: note: candidates are:
<unnamed>::temp_dir_path_tests()::guarded_tmp_vars::guarded_tmp_vars(const
boost::filesystem3::path::value_type*, const
boost::filesystem3::path::value_type*, const
boost::filesystem3::path::value_type*)
..\v3\test\operations_test.cpp:1573:7: note:
<unnamed>::temp_dir_path_tests()::guarded_tmp_vars::guarded_tmp_vars(const<unnamed>::temp_dir_path_tests()::guarded_tmp_vars&)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk