File tree Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Original file line number Diff line number Diff line change @@ -147,30 +147,8 @@ pub fn open(path string) !File {
147147}
148148
149149// create creates or opens a file at a specified location and returns a write-only `File` object.
150+ @[noinline]
150151pub fn create (path string ) ! File {
151- /*
152- // Note: android/termux/bionic is also a kind of linux,
153- // but linux syscalls there sometimes fail,
154- // while the libc version should work.
155- $if linux {
156- $if !android {
157- // $if macos {
158- // fd = C.syscall(398, path.str, 0x601, 0x1b6)
159- // }
160- // $if linux {
161- fd = C.syscall(sys_creat, path.str, 511)
162- // }
163- if fd == -1 {
164- return error('failed to create file "$path"')
165- }
166- file = File{
167- fd: fd
168- is_opened: true
169- }
170- return file
171- }
172- }
173- */
174152 cfile := vfopen (path, 'wb' )!
175153 fd := fileno (cfile)
176154 return File{
You can’t perform that action at this time.
0 commit comments