| 616 | } |
| 617 | |
| 618 | bool TruncateFile(FILE *file, unsigned int length) { |
| 619 | #if defined(WIN32) |
| 620 | return _chsize(_fileno(file), length) == 0; |
| 621 | #else |
| 622 | return ftruncate(fileno(file), length) == 0; |
| 623 | #endif |
| 624 | } |
| 625 | |
| 626 | /** |
| 627 | * this function tries to raise the file descriptor limit to the requested number. |