2020-02-03 05:00:36 +01:00
|
|
|
// Copyright (c) 2019-2020 Alexander Medvednikov. All rights reserved.
|
2019-11-17 04:45:20 +01:00
|
|
|
// Use of this source code is governed by an MIT license
|
|
|
|
// that can be found in the LICENSE file.
|
|
|
|
module compiler
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
2020-02-09 10:08:04 +01:00
|
|
|
fn get_vtmp_folder() string {
|
2020-03-07 22:26:26 +01:00
|
|
|
vtmp := os.join(os.tmpdir(),'v')
|
2019-12-19 22:29:37 +01:00
|
|
|
if !os.is_dir(vtmp) {
|
|
|
|
os.mkdir(vtmp)or{
|
|
|
|
panic(err)
|
|
|
|
}
|
2019-11-17 04:45:20 +01:00
|
|
|
}
|
|
|
|
return vtmp
|
|
|
|
}
|
|
|
|
|
2020-02-09 10:08:04 +01:00
|
|
|
fn get_vtmp_filename(base_file_name string, postfix string) string {
|
2019-11-17 04:45:20 +01:00
|
|
|
vtmp := get_vtmp_folder()
|
2020-03-07 22:26:26 +01:00
|
|
|
return os.realpath(os.join(vtmp,os.filename(os.realpath(base_file_name)) + postfix))
|
2019-11-17 04:45:20 +01:00
|
|
|
}
|