MCPcopy Create free account
hub / github.com/Atmosphere-NX/Atmosphere / OpenDirectory

Function OpenDirectory

fusee/program/source/fs/fusee_fs_api.cpp:180–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 Result OpenDirectory(DirectoryHandle *out_dir, const char *path) {
181 /* Find a free directory. */
182 for (size_t i = 0; i < MaxDirectories; ++i) {
183 if (!g_dirs_opened[i]) {
184 /* Open the file. */
185 DIR *dp = std::addressof(g_dirs[i]);
186 R_TRY(TranslateFatFsError(f_opendir(dp, path)));
187
188 /* Set the output. */
189 out_dir->_handle = dp;
190 g_dirs_opened[i] = true;
191 R_SUCCEED();
192 }
193 }
194 R_THROW(fs::ResultOpenCountLimit());
195 }
196
197 Result ReadDirectory(s64 *out_count, DirectoryEntry *out_entries, DirectoryHandle handle, s64 max_entries) {
198 DIR * const dp = GetInternalDirectory(handle);

Callers 4

ProcessRequestMethod · 0.50
ForEachFileInDirectoryFunction · 0.50
ConfigureStratosphereFunction · 0.50
DoFsTestsFunction · 0.50

Calls 2

TranslateFatFsErrorFunction · 0.70
f_opendirFunction · 0.50

Tested by 1

DoFsTestsFunction · 0.40