From 94992751808b86b3990138774cb29ac921e80f8d Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Fri, 15 Nov 2019 00:15:23 +0300 Subject: [PATCH] os: mkdir syscall on linux --- vlib/os/os.v | 8 +------- vlib/os/os_nix.v | 6 ++---- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/vlib/os/os.v b/vlib/os/os.v index 821a9159a9..0b3a3cf0e3 100644 --- a/vlib/os/os.v +++ b/vlib/os/os.v @@ -31,14 +31,8 @@ pub const ( MAX_PATH = 4096 ) -/* -struct C.FILE { - -} -*/ - pub struct File { - cfile voidptr + cfile voidptr // Using void* instead of FILE* } struct FileInfo { diff --git a/vlib/os/os_nix.v b/vlib/os/os_nix.v index 6c118df700..f838322466 100644 --- a/vlib/os/os_nix.v +++ b/vlib/os/os_nix.v @@ -57,13 +57,11 @@ pub fn dir_exists(path string) bool { // mkdir creates a new directory with the specified path. pub fn mkdir(path string) { - /* $if linux { - C.syscall(C.SYS_mkdir, path.str) + C.syscall(83, path.str, 511) // sys_mkdir } $else { - */ C.mkdir(path.str, 511)// S_IRWXU | S_IRWXG | S_IRWXO - //} + } } // exec starts the specified command, waits for it to complete, and returns its output.