mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Drop padding in blk* when finalizing file
This commit is contained in:
parent
288fdc092a
commit
1eb578796c
3 changed files with 15 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue