Automatically handle File.stream and File.binstream based on modes