| 142 | } |
| 143 | |
| 144 | Result CreateFile(const char *path, s64 size) { |
| 145 | /* Create the file. */ |
| 146 | FIL fp; |
| 147 | R_TRY(TranslateFatFsError(f_open(std::addressof(fp), path, FA_CREATE_NEW | FA_READ | FA_WRITE))); |
| 148 | |
| 149 | /* Ensure that we close the file when we're done with it. */ |
| 150 | ON_SCOPE_EXIT { f_close(std::addressof(fp)); }; |
| 151 | |
| 152 | /* Expand the file. */ |
| 153 | R_TRY(TranslateFatFsError(f_expand(std::addressof(fp), size, 1))); |
| 154 | |
| 155 | R_SUCCEED(); |
| 156 | } |
| 157 | |
| 158 | Result CreateDirectory(const char *path) { |
| 159 | R_RETURN(TranslateFatFsError(f_mkdir(path))); |