[SOLVED] Writing limitations to SD card after ~250 writings?

PaulS:

	if(ch == 0)

How are you sending data to the Arduino? Sending a binary 0 seems like a strange thing to do.

With ch=Serial.read();
and now with char ch = '0';
don't?

PaulS:
startlogging() is incorrectly named, since it does not start the logging.

O_o but it starts. that works fine. stopping don't work.

PaulS:
The else clause is misplaced, now, since the file is not created in startlogging().

i've created the file when checking for ch (serial.read).
and startlogging will just execute when ch get's something else, but not 0. and if ch is not 0, i've opened the file.