1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
#+build js wasm32, js wasm64p32
#+private
package os
// None of this does anything on js/wasm.
// It's only here so importing `core:os` on wasm panics cleanly,
// without spamming about all sorts of missing procs and types.
import "base:runtime"
import "core:io"
import "core:time"
File_Impl :: struct {
file: File,
}
_open :: proc(name: string, flags: File_Flags, perm: Permissions) -> (f: ^File, err: Error) {
return nil, .Unsupported
}
_new_file :: proc(handle: uintptr, name: string, allocator: runtime.Allocator) -> (f: ^File, err: Error) {
return nil, .Unsupported
}
_clone :: proc(f: ^File) -> (clone: ^File, err: Error) {
return nil, .Unsupported
}
_close :: proc(f: ^File_Impl) -> (err: Error) {
return .Unsupported
}
_fd :: proc(f: ^File) -> uintptr {
return 0
}
_is_tty :: proc "contextless" (f: ^File) -> bool {
return true
}
_name :: proc(f: ^File) -> string {
return ""
}
_sync :: proc(f: ^File) -> Error {
return .Unsupported
}
_truncate :: proc(f: ^File, size: i64) -> Error {
return .Unsupported
}
_remove :: proc(name: string) -> Error {
return .Unsupported
}
_rename :: proc(old_path, new_path: string) -> Error {
return .Unsupported
}
_link :: proc(old_name, new_name: string) -> Error {
return .Unsupported
}
_symlink :: proc(old_name, new_name: string) -> Error {
return .Unsupported
}
_read_link :: proc(name: string, allocator: runtime.Allocator) -> (s: string, err: Error) {
return "", .Unsupported
}
_chdir :: proc(name: string) -> Error {
return .Unsupported
}
_fchdir :: proc(f: ^File) -> Error {
return .Unsupported
}
_fchmod :: proc(f: ^File, mode: Permissions) -> Error {
return .Unsupported
}
_chmod :: proc(name: string, mode: Permissions) -> Error {
return .Unsupported
}
_fchown :: proc(f: ^File, uid, gid: int) -> Error {
return .Unsupported
}
_chown :: proc(name: string, uid, gid: int) -> Error {
return .Unsupported
}
_lchown :: proc(name: string, uid, gid: int) -> Error {
return .Unsupported
}
_chtimes :: proc(name: string, atime, mtime: time.Time) -> Error {
return .Unsupported
}
_fchtimes :: proc(f: ^File, atime, mtime: time.Time) -> Error {
return .Unsupported
}
_exists :: proc(path: string) -> bool {
return false
}
_file_stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte, offset: i64, whence: io.Seek_From) -> (n: i64, err: io.Error) {
return 0, .Empty
}
|