void File::Prealloc(Int64 Size) { #ifdef _WIN_32 if (RawSeek(Size,SEEK_SET)) { Truncate(); Seek(0,SEEK_SET); } #endif }
/** this is not needed for bulk_extractor */ void File::Prealloc(int64 Size) { #ifdef _WIN_ALL if (RawSeek(Size,SEEK_SET)) { Truncate(); Seek(0,SEEK_SET); } #endif #if defined(_UNIX) && defined(USE_FALLOCATE) // fallocate is rather new call. Only latest kernels support it. // So we are not using it by default yet. int fd = fileno(hFile); if (fd >= 0) fallocate(fd, 0, 0, Size); #endif }
void File::Seek(Int64 Offset,int Method) { if (!RawSeek(Offset,Method) && AllowExceptions) ErrHandler.SeekError(FileName); }
/** Moves the pointer in the file to a specified location. Calls the <code>RawSeek</code> function. @param Offset - the length from the current position @param Method - the method to move the pointer. If <code>SEEK_SET</code>, move the pointer <code>Offset</code> number of bytes to the new location in memory. If <code>SEEK_END</code>, move the pointer to the end of the file (NOT IMPLEMENTED) If <code>SEEK_CUR</code>, move the pointer (NOT IMPLEMENTED). */ void File::Seek(int64 Offset,int Method) { //Calls RawSeek function RawSeek(Offset,Method); /*if (!RawSeek(Offset,Method) && AllowExceptions) ErrHandler.SeekError(FileName,FileNameW);*/ }