Skip to content
Snippets Groups Projects
Commit 955951f6 authored by D-AIRY's avatar D-AIRY
Browse files

Fixed append mode

parent 3375dcf9
Branches
Tags
No related merge requests found
...@@ -47,12 +47,21 @@ int CFile::create(const char *szPath, int iType) ...@@ -47,12 +47,21 @@ int CFile::create(const char *szPath, int iType)
int CFile::add(const char *szPath, int iType) int CFile::add(const char *szPath, int iType)
{ {
const char *szMode = (iType == CORE_FILE_BIN) ? "ab" : "a"; m_pFile = fopen(szPath, (iType == CORE_FILE_BIN) ? "rb+" : "r+");
if(m_pFile)
m_pFile = fopen(szPath, szMode); {
if (!m_pFile) _fseeki64(m_pFile, 0, SEEK_END);
return -1; return(0);
return 0; }
else
{
m_pFile = fopen(szPath, (iType == CORE_FILE_BIN) ? "wb+" : "w+");
if(m_pFile)
{
return(0);
}
}
return(-1);
} }
size_t CFile::readBin(void *pDest, size_t iSize) size_t CFile::readBin(void *pDest, size_t iSize)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment