Beman Dawes wrote:
temp_directory_path() on Windows is currently implemented by calling the Windows API GetTempPath() function.
Ticket https://svn.boost.org/trac/boost/ticket/5300 points out that GetTempPath() does not work as expected for environmental variables longer than roughly 130 characters. I've added a test to Boost.Filesystem that verifies that boost::filesystem::temp_directory() is affected.
The suggested fix is to use GetEnvironmentVariable to in effect implement GetTempPath() the way we would like it to work.
Not that the documented behavior of GetTempPath makes any sense to me - the default temp directory is at %LOCALAPPDATA%\Temp since Win95 or so - but the suggested fix is actually: "A workaround is to first try to use GetEnvironmentVariable on "TMP" and "TEMP", then fall back on GetTempPath." So, if implemented, it makes
OTOH, excluding the Windows directory is a breaking change for anyone currently depending on that behavior, so I thought it best to ask for comments before charging ahead.
a non-issue, unless you want to avoid calling GetTempPath entirely, in which case I would return %LOCALAPPDATA%\Temp at step 3, obtained via SHGetFolderPath.