Opened 8 years ago

#11051 new Bugs

filesystem::temp_directory_path() fails on OSX

Reported by: Gerik Rhoden <Gerik.Rhoden@…> Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc:

Description

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.

Change History (0)

Note: See TracTickets for help on using tickets.