I am trying to find a cross-platform method to delete X bytes from the end of a file.
X
Currently I have found:
Platform specific solutio
How do you think cross platform functions work? Just make your own function like this:
int truncate(int fd, long size) { #ifdef _WIN32 || _WIN64 return _chsize(fd, size); #else #ifdef POSIX return ftruncate(fd, size); #else // code for other OSes #endif #endif }