| 1054 | } |
| 1055 | |
| 1056 | bool TruncateFile(FILE *file, unsigned int length) { |
| 1057 | #if defined(WIN32) |
| 1058 | return _chsize(_fileno(file), length) == 0; |
| 1059 | #else |
| 1060 | return ftruncate(fileno(file), length) == 0; |
| 1061 | #endif |
| 1062 | } |
| 1063 | |
| 1064 | /** |
| 1065 | * this function tries to raise the file descriptor limit to the requested number. |