mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: fix tmpdir on unix
This commit is contained in:
parent
89d3075f88
commit
6cee50afda
24
vlib/os/os.v
24
vlib/os/os.v
@ -1073,27 +1073,6 @@ pub fn join(base string, dirs ...string) string {
|
||||
// tmpdir returns the path to a folder, that is suitable for storing temporary files
|
||||
pub fn tmpdir() string {
|
||||
mut path := os.getenv('TMPDIR')
|
||||
$if linux {
|
||||
if path == '' {
|
||||
path = '/tmp'
|
||||
}
|
||||
}
|
||||
$if freebsd {
|
||||
if path == '' {
|
||||
path = '/tmp'
|
||||
}
|
||||
}
|
||||
$if macos {
|
||||
/*
|
||||
if path == '' {
|
||||
// TODO untested
|
||||
path = C.NSTemporaryDirectory()
|
||||
}
|
||||
*/
|
||||
if path == '' {
|
||||
path = '/tmp'
|
||||
}
|
||||
}
|
||||
$if windows {
|
||||
if path == '' {
|
||||
// TODO see Qt's implementation?
|
||||
@ -1108,6 +1087,9 @@ pub fn tmpdir() string {
|
||||
}
|
||||
}
|
||||
}
|
||||
if path == '' {
|
||||
path = '/tmp'
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user