2020-02-03 04:00:36 +00:00
|
|
|
// Copyright (c) 2019-2020 Alexander Medvednikov. All rights reserved.
|
2019-11-17 03:45:20 +00: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 09:08:04 +00:00
|
|
|
fn get_vtmp_folder() string {
|
2020-03-10 14:02:09 +00:00
|
|
|
vtmp := os.join_path(os.temp_dir(), 'v')
|
2019-12-19 21:29:37 +00:00
|
|
|
if !os.is_dir(vtmp) {
|
2020-03-09 01:23:34 +00:00
|
|
|
os.mkdir(vtmp) or {
|
2019-12-19 21:29:37 +00:00
|
|
|
panic(err)
|
|
|
|
}
|
2019-11-17 03:45:20 +00:00
|
|
|
}
|
|
|
|
return vtmp
|
|
|
|
}
|
|
|
|
|
2020-02-09 09:08:04 +00:00
|
|
|
fn get_vtmp_filename(base_file_name string, postfix string) string {
|
2019-11-17 03:45:20 +00:00
|
|
|
vtmp := get_vtmp_folder()
|
2020-03-20 15:41:18 +00:00
|
|
|
return os.real_path(os.join_path(vtmp, os.file_name(os.real_path(base_file_name)) + postfix))
|
2019-11-17 03:45:20 +00:00
|
|
|
}
|