A second print when the input is gcode will error. This is because the input gcode is "tracked" using a input stream, and once consumed, the stream is not reusable without a rewind. I recommend tracking the file with a file name and opening the stream at the beginning of each print. Runs less risk of lock issues too. Same strategy should be applied for gcode output.