MCPcopy Create free account
hub / github.com/devkitPro/libctru / archive_rmdir

Function archive_rmdir

libctru/source/archive_dev.c:1303–1328  ·  view source on GitHub ↗

! Remove a directory * * @param[in,out] r newlib reentrancy struct * @param[in] name Path of directory to remove * * @returns 0 for success * @returns -1 for error */

Source from the content-addressed store, hash-verified

1301 * @returns -1 for error
1302 */
1303static int
1304archive_rmdir(struct _reent *r,
1305 const char *name)
1306{
1307 Result rc;
1308 FS_Path fs_path;
1309 archive_fsdevice *device = r->deviceData;
1310
1311 /* treat extdata as read-only */
1312 if(device->is_extdata)
1313 {
1314 r->_errno = ENOTSUP;
1315 return -1;
1316 }
1317
1318 fs_path = archive_utf16path(r, name, &device);
1319 if(fs_path.data == NULL)
1320 return -1;
1321
1322 rc = FSUSER_DeleteDirectory(device->archive, fs_path);
1323 if(R_SUCCEEDED(rc))
1324 return 0;
1325
1326 r->_errno = archive_translate_error(rc);
1327 return -1;
1328}
1329
1330Result
1331archive_getmtime(const char *name,

Callers

nothing calls this directly

Calls 3

archive_utf16pathFunction · 0.85
FSUSER_DeleteDirectoryFunction · 0.85
archive_translate_errorFunction · 0.85

Tested by

no test coverage detected