How can I dump a large serial stream strait to an SD card?

No I am saying the host should send how many bytes it is about to send to the Arduino that way the receiver program which is running on the Arduino knows when to stop and close the file. Yes your method if no bytes have been sent after x amount of time call sync() works too I just think that my method was easier to implement. The filesize is not written to the file. I am aware of how to get the filesize without storing it in the file already.