Core/Posix: Add absolutly not tested File::SetSize implementation

At least the engine should compile again on posix


Former-commit-id: c2ccdb9ad939b20e288b211aee678917934f1757
This commit is contained in:
Lynix 2016-05-03 23:15:22 +02:00
parent 371922ec11
commit 08926cf530
2 changed files with 6 additions and 0 deletions

View File

@ -118,6 +118,11 @@ namespace Nz
return lseek64(m_fileDescriptor, offset, moveMethod) != -1;
}
bool FileImpl::SetSize(UInt64 size)
{
return ftruncate64(m_fileDescriptor, size) != 0;
}
std::size_t FileImpl::Write(const void* buffer, std::size_t size)
{
lockf64(m_fileDescriptor, F_LOCK, size);

View File

@ -39,6 +39,7 @@ namespace Nz
bool Open(const String& filePath, UInt32 mode);
std::size_t Read(void* buffer, std::size_t size);
bool SetCursorPos(CursorPosition pos, Int64 offset);
bool SetSize(UInt64 size);
std::size_t Write(const void* buffer, std::size_t size);
FileImpl& operator=(const FileImpl&) = delete;