MMm well I think I added truncate so I'm wondering if it's really busted on non-mac platforms.
You see
int sqFileTruncate(SQFile *f,int offset) { /* Truncate the file*/
if (!sqFileValid(f)) return interpreterProxy->success(false); if (ftruncate(f->file,offset)) return interpreterProxy->success(false); f->fileSize = ftell(f->file); return 1; }
But really on Unix f->file points to a FILE structure, but ftruncate needs a file descriptor (an integer).
#include <unistd.h> int sqFileTruncate(SQFile *f,int offset) { /* Truncate the file*/
if (!sqFileValid(f)) return interpreterProxy->success(false); if (ftruncate(fileno(f->file),offset)) return interpreterProxy->success(false); f->fileSize = ftell(f->file); return 1; }
Ah, thoughts are welcome. Of course I'm going to make the change because the SUnits fail... Hint it works on the mac because ftruncate didn't exist in a workable form for CW 6 so I added one.