Page MenuHomePhabricator

[19/N] [libcxx] Fix the fallback case in temp_directory_path for windows
Needs ReviewPublic

Authored by mstorsjo on Tue, Nov 10, 8:43 AM.

Details

Reviewers
amccarth
EricWF
Group Reviewers
Restricted Project
Summary

Alternatively, the function could just call GetTempPath instead, which checks the TMP, TEMP, USERPROFILE env vars, and falls back on c:\windows.

Diff Detail

Event Timeline

mstorsjo created this revision.Tue, Nov 10, 8:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptTue, Nov 10, 8:43 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript
compnerd added inline comments.
libcxx/src/filesystem/operations.cpp
1599

What do you think of using GetTempPath instead? That is more likely to be writable.

mstorsjo added inline comments.Tue, Nov 10, 10:57 AM
libcxx/src/filesystem/operations.cpp
1599

That's also an option - or we could skip our own code and just use that one. That function does essentially the same, checks a few env vars (two of the ones checked here, plus USERPROFILE). But if none of the env vars are available, GetTempPath also falls back to c:\windows - that's where I got the idea.