! Unlink a file * * @param[in,out] r newlib reentrancy struct * @param[in] name Path of file to unlink * * @returns 0 for success * @returns -1 for error */
| 860 | * @returns -1 for error |
| 861 | */ |
| 862 | static int |
| 863 | archive_unlink(struct _reent *r, |
| 864 | const char *name) |
| 865 | { |
| 866 | Result rc; |
| 867 | FS_Path fs_path; |
| 868 | archive_fsdevice *device = r->deviceData; |
| 869 | |
| 870 | fs_path = archive_utf16path(r, name, &device); |
| 871 | if(fs_path.data == NULL) |
| 872 | return -1; |
| 873 | |
| 874 | rc = FSUSER_DeleteFile(device->archive, fs_path); |
| 875 | if(R_SUCCEEDED(rc)) |
| 876 | return 0; |
| 877 | |
| 878 | r->_errno = archive_translate_error(rc); |
| 879 | return -1; |
| 880 | } |
| 881 | |
| 882 | /*! Change current working directory |
| 883 | * |
nothing calls this directly
no test coverage detected