os/linux: move-file-path impl

This commit is contained in:
Ryan Fleury
2025-07-28 14:54:48 -07:00
parent 2e8c0875c8
commit 09f9cc25df
2 changed files with 14 additions and 6 deletions
+10 -2
View File
@@ -446,8 +446,16 @@ os_copy_file_path(String8 dst, String8 src)
internal B32
os_move_file_path(String8 dst, String8 src)
{
// TODO(rjf)
return 0;
B32 good = 0;
Temp scratch = scratch_begin(0, 0);
{
char *src_cstr = (char *)push_str8_copy(scratch.arena, src).str;
char *dst_cstr = (char *)push_str8_copy(scratch.arena, dst).str;
int rename_result = rename(src_cstr, dst_cstr);
good = (rename_result != -1);
}
scratch_end(scratch);
return good;
}
internal String8