mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-12 16:38:08 +00:00
check if rdi path is writable before deciding to convert to it; if it isn't writable, then redirect to a rdi cache directory
This commit is contained in:
@@ -750,6 +750,27 @@ di_async_tick(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//- rjf: determine if RDI path is writable; if not, need to write into the writable cache path
|
||||||
|
if(!t->og_folder_analyzed)
|
||||||
|
{
|
||||||
|
t->og_folder_analyzed = 1;
|
||||||
|
File file = file_open(AccessFlag_Write, rdi_path);
|
||||||
|
t->og_folder_is_writable = !file_match(file, file_zero());
|
||||||
|
file_close(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
//- rjf: if RDI path is not writable -> adjust into writable cache directory
|
||||||
|
if(!t->og_folder_is_writable)
|
||||||
|
{
|
||||||
|
String8 cache_folder = get_process_info()->user_program_cache_data_path;
|
||||||
|
String8 raddbg_folder = str8f(scratch.arena, "%S/raddbg", cache_folder);
|
||||||
|
String8 rdis_folder = str8f(scratch.arena, "%S/rdis", raddbg_folder);
|
||||||
|
make_directory(cache_folder);
|
||||||
|
make_directory(raddbg_folder);
|
||||||
|
make_directory(rdis_folder);
|
||||||
|
rdi_path = str8f(scratch.arena, "%S/%S.rdi", rdis_folder, str8_chop_last_dot(str8_skip_last_slash(og_path)));
|
||||||
|
}
|
||||||
|
|
||||||
//- rjf: determine if RDI is stale
|
//- rjf: determine if RDI is stale
|
||||||
if(!t->rdi_analyzed && !og_is_downloading)
|
if(!t->rdi_analyzed && !og_is_downloading)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -139,6 +139,8 @@ struct DI_LoadTask
|
|||||||
|
|
||||||
B32 og_analyzed;
|
B32 og_analyzed;
|
||||||
B32 og_is_rdi;
|
B32 og_is_rdi;
|
||||||
|
B32 og_folder_analyzed;
|
||||||
|
B32 og_folder_is_writable;
|
||||||
U64 og_size;
|
U64 og_size;
|
||||||
|
|
||||||
B32 rdi_analyzed;
|
B32 rdi_analyzed;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
//~ rjf: @per_os_impl Top-Level Layer Calls
|
//~ rjf: @per_os_impl Top-Level Layer Calls
|
||||||
|
|
||||||
internal void http_init(void){}
|
internal void http_init(void){}
|
||||||
|
internal void http_async_tick(void){}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
//~ rjf: @per_os_impl I/O Ring Functions
|
//~ rjf: @per_os_impl I/O Ring Functions
|
||||||
|
|||||||
Reference in New Issue
Block a user