1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

os: cleanup APIs returning !bool to either return ! or bool (#16111)

This commit is contained in:
Delyan Angelov
2022-10-20 13:56:06 +03:00
committed by GitHub
parent ac63fa1b11
commit 2083e6b04c
13 changed files with 69 additions and 109 deletions

View File

@@ -177,3 +177,10 @@ pub fn file_last_mod_unix(path string) int {
return mtime
}
pub fn ensure_folder_is_writable(path string) ! {
fpath := join_path(path, 'some_newfile')
#try { $fs.writeFileSync(fpath); $fs.unlinkSync(fpath) } catch(e) { return error(new string('could not write to ' + path)) }
_ := fpath
}