Function path::temp_directory() returns a path to OS-specific temporary directory. On Windows and OSX it is usually a dir under user's control, on Linux it is usually /tmp.
This function is going to replace path::system_temp_directory(true).
Details
- Reviewers
aaron.ballman • rafael
Diff Detail
Event Timeline
include/llvm/Support/Path.h | ||
---|---|---|
336 | Why is Path1 required to pass to the function? | |
lib/Support/Unix/Path.inc | ||
563 | Is there a reason this is a bool instead of an int? | |
646 | Do you have to call Result.clear() here in the event getDarwinConfDir() fails but modifies Result? | |
lib/Support/Windows/Path.inc | ||
816 | I know this isn't yours, but this is a terrible idea just the same. We should not be hard coding paths on Windows. I have a slight preference for this API to return a bool indicating failure, but at the same time, I struggle to imagine what error recovery would look like. I think I could be persuaded that failures here should assert and fail. | |
824 | Do you need to clear Result if user_cache_directory() fails? |
include/llvm/Support/Path.h | ||
---|---|---|
336 | It was discussed around user_cache_directory(). It is not good idea to place files there directly so the API enforces appending at least one path element. | |
lib/Support/Unix/Path.inc | ||
563 | Not any particular reason. I was replacing bool flag, so I used bool. | |
646 | getDarwinConfDir() either clears or does not modify Result in case of failure. | |
lib/Support/Windows/Path.inc | ||
824 | No. user_cache_directory() will either clear or not modify Result in case of failure. |
include/llvm/Support/Path.h | ||
---|---|---|
336 | That's not the case for the temp directory on Windows, but is the case for the user_cached_directory(). Temp files generally live directly in the temp directory on Windows, and folders are only used when there is a chance the file names will conflict with an existing file. However, the usual pattern when in the temp directory is to pick a temp file name, and so those conflicts do not happen. However, with the user's cache directory, those files are longer-lived, and so they tend to have specific file names that can conflict. | |
lib/Support/Unix/Path.inc | ||
563 | I'm not keen on the bool because then comparisons below are effectively if (bool == bool) instead of if (bool). I have a slight preference for unsigned here. |
Why is Path1 required to pass to the function?