/* * OmniNX Installer - Filesystem operations * Based on HATS Installer */ #pragma once #include #define FS_PATH_MAX 512 // Called once per processed entry (file or folder) by the tree walkers. typedef void (*fs_progress_cb)(void *ctx); // Error code to string const char *fs_error_str(int err); // File/folder operations - return FR_OK (0) on success int file_copy(const char *src, const char *dst); int folder_copy(const char *src_dir, const char *dst_parent); // copies into dst_parent/ int folder_delete(const char *path); // Delete a file or folder tree (missing path = FR_OK). int fs_delete_tree(const char *path, fs_progress_cb cb, void *ctx); // Move a file, replacing dst (rename, copy as fallback). int fs_move_file(const char *src, const char *dst); // Move folder src_dir into dst_parent/, merging into an existing folder. int fs_move_tree(const char *src_dir, const char *dst_parent, fs_progress_cb cb, void *ctx); // Count entries below path; stops at limit (0 = count everything). u32 fs_count_items(const char *path, u32 limit); // Free the shared copy buffer. void fs_release_buffers(void); // File logging (enabled via debug.ini log=1) void log_init(const char *path); void log_close(void); void log_write(const char *fmt, ...); bool log_is_enabled(void);