[Boost-bugs] [Boost C++ Libraries] #11051: filesystem::temp_directory_path() fails on OSX

Subject: [Boost-bugs] [Boost C++ Libraries] #11051: filesystem::temp_directory_path() fails on OSX
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-02-20 12:17:08


#11051: filesystem::temp_directory_path() fails on OSX
-------------------------------------------+------------------------
 Reporter: Gerik Rhoden <Gerik.Rhoden@…> | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
-------------------------------------------+------------------------
 On OSX the call to filesystem::temp_directory_path() throws an exception
 with error ENOTDIR.

 This happens because on OSX the environment variable TMPDIR has a trailing
 /. There are quite a few references to this on the web.

 On my system OSX 10.10.2 the TMPDIR is set to:
 /var/folders/r8/y110f55j7ws94zpl8wfdpfpx13r441/T/

 Workaround: Use
   system::error_code ec;
   filesystem::path p = filesystem::temp_directory_path(ec);
 and ignore the error code. (which is ENOTDIR)

 Suggested fix: Remove trailing / after getting environment variable in
 "boost_1_57_0\libs\filesystem\src\operations.cpp" at around line 1770.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11051>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC