mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: tmpdir => temp_dir
This commit is contained in:
@@ -1106,7 +1106,7 @@ pub fn cache_dir() string {
|
||||
}
|
||||
|
||||
// tmpdir returns the path to a folder, that is suitable for storing temporary files
|
||||
pub fn tmpdir() string {
|
||||
pub fn temp_dir() string {
|
||||
mut path := os.getenv('TMPDIR')
|
||||
$if windows {
|
||||
if path == '' {
|
||||
|
@@ -164,7 +164,7 @@ fn test_cp_r() {
|
||||
}
|
||||
|
||||
fn test_tmpdir(){
|
||||
t := os.tmpdir()
|
||||
t := os.temp_dir()
|
||||
assert t.len > 0
|
||||
assert os.is_dir(t)
|
||||
|
||||
@@ -247,7 +247,7 @@ fn test_symlink() {
|
||||
}
|
||||
|
||||
fn test_is_executable_writable_readable() {
|
||||
file_name := os.tmpdir() + os.path_separator + 'rwxfile.exe'
|
||||
file_name := os.temp_dir() + os.path_separator + 'rwxfile.exe'
|
||||
|
||||
mut f := os.create(file_name) or {
|
||||
eprintln('failed to create file $file_name')
|
||||
|
Reference in New Issue
Block a user