Drop padding in blk* when finalizing file
This commit is contained in:
committed by
Pieter Wuille
parent
288fdc092a
commit
1eb578796c
@@ -1161,6 +1161,14 @@ int GetFilesize(FILE* file)
|
||||
return nFilesize;
|
||||
}
|
||||
|
||||
bool TruncateFile(FILE *file, unsigned int length) {
|
||||
#if defined(WIN32)
|
||||
return _chsize(_fileno(file), length) == 0;
|
||||
#else
|
||||
return ftruncate(fileno(file), length) == 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// this function tries to make a particular range of a file allocated (corresponding to disk space)
|
||||
// it is advisory, and the range specified in the arguments will never contain live data
|
||||
void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) {
|
||||
|
||||
Reference in New Issue
Block a user