Search found 2 matches

by hamm
Fri Aug 21, 2009 5:35 pm
Forum: DS/DSi Development
Topic: Can't get (f)truncate working
Replies: 3
Views: 4967

Re: Can't get (f)truncate working

I tested it directly on the dsl hardware.

It's not necessary to open the file before. I tested it but it doesn't change anything.
by hamm
Fri Aug 21, 2009 2:34 pm
Forum: DS/DSi Development
Topic: Can't get (f)truncate working
Replies: 3
Views: 4967

Can't get (f)truncate working

I want to reduce the size of a file without copying and tried the following.

#include <nds.h>
#include <fat.h>
#include <stdio.h>
#include <unistd.h>

int main(void) {

fatInitDefault();
truncate("test.dat", 123);

while(1) {
swiWaitForVBlank();
}

return 0;
}

I also added -lfat in LIBS ...