C++ File::open in Ruby style