MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / Prealloc

Method Prealloc

Libraries/unrar/file.cpp:541–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539
540
541void File::Prealloc(int64 Size)
542{
543#ifdef _WIN_ALL
544 if (RawSeek(Size,SEEK_SET))
545 {
546 Truncate();
547 Seek(0,SEEK_SET);
548 }
549#endif
550
551#if defined(_UNIX) && defined(USE_FALLOCATE)
552 // fallocate is rather new call. Only latest kernels support it.
553 // So we are not using it by default yet.
554 int fd = GetFD();
555 if (fd >= 0)
556 fallocate(fd, 0, 0, Size);
557#endif
558}
559
560
561byte File::GetByte()

Callers 2

RestoreMethod · 0.80
ExtractCurrentFileMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected