v.util: make get_vtmp_folder() return `/tmp/v_{uid}` by default (see https://github.com/vlang/v/discussions/11796)

pull/12422/head
Delyan Angelov 2021-11-09 08:25:19 +02:00
parent 08667c5645
commit 3f841edec1
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 2 additions and 1 deletions

View File

@ -483,7 +483,8 @@ pub fn get_vtmp_folder() string {
if vtmp.len > 0 {
return vtmp
}
vtmp = os.join_path(os.temp_dir(), 'v')
uid := os.getuid()
vtmp = os.join_path(os.temp_dir(), 'v_$uid')
if !os.exists(vtmp) || !os.is_dir(vtmp) {
os.mkdir_all(vtmp) or { panic(err) }
}