Halsafar, if the length will only ever be at max, 255, just write, in binary, the lenth as a BYTE at the beginning of the file.