2019-11-17 04:45:20 +01:00
|
|
|
// 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
|
|
|
|
import filepath
|
|
|
|
|
|
|
|
pub fn get_vtmp_folder() string {
|
|
|
|
vtmp := filepath.join(os.tmpdir(),'v')
|
2019-12-04 21:03:12 +01:00
|
|
|
if !os.is_dir( vtmp ) {
|
2019-11-23 17:55:18 +01:00
|
|
|
os.mkdir(vtmp) or { panic(err) }
|
2019-11-17 04:45:20 +01:00
|
|
|
}
|
|
|
|
return vtmp
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn get_vtmp_filename(base_file_name string, postfix string) string {
|
|
|
|
vtmp := get_vtmp_folder()
|
2019-11-30 06:01:31 +01:00
|
|
|
return os.realpath( filepath.join(vtmp, os.filename( os.realpath(base_file_name) ) + postfix) )
|
2019-11-17 04:45:20 +01:00
|
|
|
}
|