os: mkdir syscall on linux
parent
2545e1c22c
commit
9499275180
|
@ -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 {
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue