| 376 | } |
| 377 | |
| 378 | static int dfs_win32_unlink(struct dfs_filesystem *fs, const char *path) |
| 379 | { |
| 380 | int result; |
| 381 | char *fp; |
| 382 | fp = winpath_dirdup(WIN32_DIRDISK_ROOT, path); |
| 383 | if (fp == RT_NULL) |
| 384 | { |
| 385 | rt_kprintf("out of memory.\n"); |
| 386 | return -ENOMEM; |
| 387 | } |
| 388 | |
| 389 | result = GetFileAttributes(fp); |
| 390 | if (result == INVALID_FILE_ATTRIBUTES) |
| 391 | goto __err; |
| 392 | |
| 393 | if (result & FILE_ATTRIBUTE_DIRECTORY)//winnt.h |
| 394 | { |
| 395 | if (RemoveDirectory(fp) == RT_FALSE) |
| 396 | goto __err; |
| 397 | } |
| 398 | else //(result & FILE_ATTRIBUTE_NORMAL) |
| 399 | { |
| 400 | if (_unlink(fp) < 0) |
| 401 | goto __err; |
| 402 | } |
| 403 | |
| 404 | rt_free(fp); |
| 405 | return 0; |
| 406 | __err: |
| 407 | rt_free(fp); |
| 408 | return win32_result_to_dfs(GetLastError()); |
| 409 | } |
| 410 | |
| 411 | static int dfs_win32_rename( |
| 412 | struct dfs_filesystem *fs, |
nothing calls this directly
no test coverage detected