os: mkdir syscall on linux

pull/2764/head
Alexander Medvednikov 2019-11-15 00:15:23 +03:00
parent 2545e1c22c
commit 9499275180
2 changed files with 3 additions and 11 deletions

View File

@ -31,14 +31,8 @@ pub const (
MAX_PATH = 4096 MAX_PATH = 4096
) )
/*
struct C.FILE {
}
*/
pub struct File { pub struct File {
cfile voidptr cfile voidptr // Using void* instead of FILE*
} }
struct FileInfo { struct FileInfo {

View File

@ -57,13 +57,11 @@ pub fn dir_exists(path string) bool {
// mkdir creates a new directory with the specified path. // mkdir creates a new directory with the specified path.
pub fn mkdir(path string) { pub fn mkdir(path string) {
/*
$if linux { $if linux {
C.syscall(C.SYS_mkdir, path.str) C.syscall(83, path.str, 511) // sys_mkdir
} $else { } $else {
*/
C.mkdir(path.str, 511)// S_IRWXU | S_IRWXG | S_IRWXO 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. // exec starts the specified command, waits for it to complete, and returns its output.