dir_posix_darwin.odin 422 B

1234567891011121314151617
  1. #+private
  2. package os2
  3. import "core:sys/darwin"
  4. _copy_directory_all_native :: proc(dst, src: string, dst_perm := 0o755) -> (err: Error) {
  5. temp_allocator := TEMP_ALLOCATOR_GUARD({})
  6. csrc := clone_to_cstring(src, temp_allocator) or_return
  7. cdst := clone_to_cstring(dst, temp_allocator) or_return
  8. if darwin.copyfile(csrc, cdst, nil, darwin.COPYFILE_ALL + {.RECURSIVE}) < 0 {
  9. err = _get_platform_error()
  10. }
  11. return
  12. }