Properly creates file stream.