Just for what it's worth, if you're just copying the data from one stream to another, there's no need to worry about doing it line by line -- the lines are determined by new-line characters (or carriage returns and/or carriage return/line feed combos) in the data.
If you simply copy the data through without changing it, the lines will be preserved. To maximize speed, you probably want to open the file in binary mode, and use fread/fwrite to copy fairly large chunks (e.g. 4 megabytes) of data at a time.