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

os: fix create()

This commit is contained in:
Alexander Medvednikov 2020-01-01 12:57:27 +01:00
parent 47908c22df
commit b7663848ef

View File

@ -99,12 +99,14 @@ pub fn create(path string) ?File {
//$if linux_or_macos { //$if linux_or_macos {
mut fd := 0 mut fd := 0
//println('creat SYS') //println('creat SYS')
/*
$if macos { $if macos {
fd = C.syscall(sys_open_nocancel, path.str, 0x601, 0x1b6) fd = C.syscall(sys_open_nocancel, path.str, 0x601, 0x1b6)
} }
$else { $else {
fd = C.syscall(sys_creat, path.str, 511) */
} fd = C.syscall(sys_creat, path.str, 511)
//}
//println('fd=$fd') //println('fd=$fd')
if fd == -1 { if fd == -1 {
return error('failed to create file "$path"') return error('failed to create file "$path"')