case End:
whence = FILE_END;
break;
+ default:
+ debug("FileStream::seek() -- Invalid Position value.");
+ return;
}
SetFilePointer(d->file, offset, NULL, whence);
case End:
whence = SEEK_END;
break;
+ default:
+ debug("FileStream::seek() -- Invalid Position value.");
+ return;
}
fseek(d->file, offset, whence);
if(!d->file)
return 0;
- long curpos = tell();
+ const long curpos = tell();
seek(0, End);
- long endpos = tell();
+ const long endpos = tell();
seek(curpos, Beginning);
{
#ifdef _WIN32
- long currentPos = tell();
+ const long currentPos = tell();
seek(length);
SetEndOfFile(d->file);
#else
- ftruncate(fileno(d->file), length);
+ const int error = ftruncate(fileno(d->file), length);
+ if(error != 0) {
+ debug("FileStream::truncate() -- Coundn't truncate the file.");
+ }
#endif
}