aboutsummaryrefslogtreecommitdiff
path: root/core/os/dir_posix_darwin.odin
blob: e67c917b42a89ac0bff78d43b104239181afb13f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#+private
package os

import "core:sys/darwin"

_copy_directory_all_native :: proc(dst, src: string, dst_perm := 0o755) -> (err: Error) {
	temp_allocator := TEMP_ALLOCATOR_GUARD({})

	csrc := clone_to_cstring(src, temp_allocator) or_return
	cdst := clone_to_cstring(dst, temp_allocator) or_return

	if darwin.copyfile(csrc, cdst, nil, darwin.COPYFILE_ALL + {.RECURSIVE}) < 0 {
		err = _get_platform_error()
	}

	return
}