mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Implement BfpDirectory_Rename for Posix.
This commit is contained in:
parent
e9a2851095
commit
8c6092504a
1 changed files with 21 additions and 1 deletions
|
@ -1822,7 +1822,27 @@ BFP_EXPORT void BFP_CALLTYPE BfpDirectory_Create(const char* path, BfpFileResult
|
|||
|
||||
BFP_EXPORT void BFP_CALLTYPE BfpDirectory_Rename(const char* oldName, const char* newName, BfpFileResult* outResult)
|
||||
{
|
||||
NOT_IMPL;
|
||||
if (rename(oldName, newName) != 0)
|
||||
{
|
||||
switch (errno)
|
||||
{
|
||||
case EEXIST:
|
||||
OUTRESULT(BfpFileResult_AlreadyExists);
|
||||
break;
|
||||
case ENOTEMPTY:
|
||||
OUTRESULT(BfpFileResult_NotEmpty);
|
||||
break;
|
||||
case EISDIR:
|
||||
case ENOTDIR:
|
||||
OUTRESULT(BfpFileResult_InvalidParameter);
|
||||
break;
|
||||
default:
|
||||
OUTRESULT(BfpFileResult_UnknownError);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
OUTRESULT(BfpFileResult_Ok);
|
||||
}
|
||||
|
||||
BFP_EXPORT void BFP_CALLTYPE BfpDirectory_Delete(const char* path, BfpFileResult* outResult)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue