9c6b516453
- Reorganize repository to Rust-style layout: compiler/bootstrap/ compiler/selfhost/ compiler/tests/ library/std/ library/runtime/ tests/ tools/ - Add buxs/ Windows-compatible project root - Add borrow checker tests and implement: - Alias analysis (double mutable borrow detection) - Use-after-move detection for own T - Expand standard library: - Std::Os: Args, Env, Cwd, Chdir - Std::Time: NowMs, NowUs, SleepMs - Std::Process: Run, Output - Std::Io: PrintInt64 (fixes 32-bit truncation bug) - Add examples: os_time.bux, process.bux - Fix PrintInt to use int64_t in C runtime
20 lines
475 B
Plaintext
20 lines
475 B
Plaintext
module Std::Fs {
|
|
|
|
extern func bux_dir_exists(path: String) -> int;
|
|
extern func bux_mkdir_if_needed(path: String) -> int;
|
|
extern func bux_list_dir(dir: String, ext: String, out_count: *int) -> *String;
|
|
|
|
func DirExists(path: String) -> bool {
|
|
return bux_dir_exists(path) != 0;
|
|
}
|
|
|
|
func Mkdir(path: String) -> bool {
|
|
return bux_mkdir_if_needed(path) != 0;
|
|
}
|
|
|
|
func ListDir(dir: String, ext: String, count: *int) -> *String {
|
|
return bux_list_dir(dir, ext, count);
|
|
}
|
|
|
|
}
|