Also works for handling the shutdown signal
Update
Need to use two streams. .mark() relies on buffering the entire file, which doesn't work if it's massive.