1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
Alexander Medvednikov
2019-12-20 00:29:37 +03:00
parent b6fe2ebc0b
commit 6210984c97
54 changed files with 1757 additions and 1993 deletions

View File

@ -1,7 +1,6 @@
// Copyright (c) 2019 Alexander Medvednikov. All rights reserved.
// Use of this source code is governed by an MIT license
// that can be found in the LICENSE file.
module compiler
import os
@ -9,13 +8,16 @@ import filepath
pub fn get_vtmp_folder() string {
vtmp := filepath.join(os.tmpdir(),'v')
if !os.is_dir( vtmp ) {
os.mkdir(vtmp) or { panic(err) }
if !os.is_dir(vtmp) {
os.mkdir(vtmp)or{
panic(err)
}
}
return vtmp
}
pub fn get_vtmp_filename(base_file_name string, postfix string) string {
vtmp := get_vtmp_folder()
return os.realpath( filepath.join(vtmp, os.filename( os.realpath(base_file_name) ) + postfix) )
return os.realpath(filepath.join(vtmp,os.filename(os.realpath(base_file_name)) + postfix))
}