os2: better copy_directory, and add native copy_file and copy_directory variants on MacOS

This commit is contained in:
Laytan Laats
2025-05-08 19:32:30 +02:00
parent edbe7aa06e
commit cacb9f9f54
8 changed files with 162 additions and 25 deletions
+9
View File
@@ -313,6 +313,15 @@ is_directory :: proc(path: string) -> bool {
copy_file :: proc(dst_path, src_path: string) -> Error {
when #defined(_copy_file_native) {
return _copy_file_native(dst_path, src_path)
} else {
return _copy_file(dst_path, src_path)
}
}
@(private)
_copy_file :: proc(dst_path, src_path: string) -> Error {
src := open(src_path) or_return
defer close(src)