1
0
Fork 0
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:
MineBill 2025-04-15 12:28:45 +03:00
parent e9a2851095
commit 8c6092504a
No known key found for this signature in database

View file

@ -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)