From a569959fb88e98a9a9dee6bd34434b84893f0a70 Mon Sep 17 00:00:00 2001 From: yuyi Date: Sun, 8 Mar 2020 22:57:47 +0800 Subject: [PATCH] os api: cachedir => cache_dir --- vlib/compiler/tests/repl/repl_test.v | 4 ++-- vlib/os/os.v | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vlib/compiler/tests/repl/repl_test.v b/vlib/compiler/tests/repl/repl_test.v index 1bfa5ae827..e7b1f1cae7 100644 --- a/vlib/compiler/tests/repl/repl_test.v +++ b/vlib/compiler/tests/repl/repl_test.v @@ -36,7 +36,7 @@ fn test_all_v_repl_files() { bmark: benchmark.new_benchmark() } // warmup, and ensure that the vrepl is compiled in single threaded mode if it does not exist - runner.run_repl_file(os.cachedir(), session.options.vexec, 'vlib/compiler/tests/repl/nothing.repl') or { + runner.run_repl_file(os.cache_dir(), session.options.vexec, 'vlib/compiler/tests/repl/nothing.repl') or { panic(err) } session.bmark.set_total_expected_steps(session.options.files.len) @@ -54,7 +54,7 @@ fn test_all_v_repl_files() { } fn worker_repl(p mut sync.PoolProcessor, idx int, thread_id int) voidptr { - cdir := os.cachedir() + cdir := os.cache_dir() mut session := &Session(p.get_shared_context()) mut tls_bench := &benchmark.Benchmark(p.get_thread_context(idx)) if isnil(tls_bench) { diff --git a/vlib/os/os.v b/vlib/os/os.v index 73196c3173..977de92ff5 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -1123,8 +1123,8 @@ pub fn mkdir_all(path string) { } } -// cachedir returns the path to a *writable* user specific folder, suitable for writing non-essential data. -pub fn cachedir() string { +// cache_dir returns the path to a *writable* user specific folder, suitable for writing non-essential data. +pub fn cache_dir() string { // See: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html // There is a single base directory relative to which user-specific non-essential // (cached) data should be written. This directory is defined by the environment @@ -1165,7 +1165,7 @@ pub fn tmpdir() string { } } if path == '' { - path = os.cachedir() + path = os.cache_dir() } if path == '' { path = '/tmp'