mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
add os.tmpDir to get the recommended temp dir base path
This commit is contained in:
@ -50,3 +50,10 @@ pub fn fixMaxFiles() void {
|
|||||||
|
|
||||||
log.debug("file handle limit raised value={}", .{lim.cur});
|
log.debug("file handle limit raised value={}", .{lim.cur});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return the recommended path for temporary files.
|
||||||
|
pub fn tmpDir() ?[]const u8 {
|
||||||
|
if (std.os.getenv("TMPDIR")) |v| return v;
|
||||||
|
if (std.os.getenv("TMP")) |v| return v;
|
||||||
|
return "/tmp";
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user