// ----------------------------------------------------------------------------
// read
-size_t wxFile::Read(void *pBuf, size_t nCount)
+ssize_t wxFile::Read(void *pBuf, size_t nCount)
{
wxCHECK( (pBuf != NULL) && IsOpened(), 0 );
if ( iRc == -1 )
{
wxLogSysError(_("can't read from file descriptor %d"), m_fd);
- return (size_t)wxInvalidOffset;
+ return wxInvalidOffset;
}
return iRc;
bool wxFile::Flush()
{
if ( IsOpened() ) {
-#if defined(__VISUALC__) || wxHAVE_FSYNC
+#if defined(__VISUALC__) || defined(HAVE_FSYNC)
if ( wxFsync(m_fd) == -1 )
{
wxLogSysError(_("can't flush file descriptor %d"), m_fd);
// seek
wxFileOffset wxFile::Seek(wxFileOffset ofs, wxSeekMode mode)
{
- wxASSERT( IsOpened() );
+ wxASSERT_MSG( IsOpened(), _T("can't seek on closed file") );
+ wxCHECK_MSG( ofs != wxInvalidOffset || mode != wxFromStart,
+ wxInvalidOffset,
+ _T("invalid absolute file offset") );
int origin;
switch ( mode ) {
break;
}
- if (ofs == wxInvalidOffset)
- {
- wxLogSysError(_("can't seek on file descriptor %d, large files support is not enabled."), m_fd);
- return wxInvalidOffset;
- }
wxFileOffset iRc = wxSeek(m_fd, ofs, origin);
if ( iRc == wxInvalidOffset )
{