Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 25th, 2012  |  syntax: None  |  size: 0.19 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to open file in default application. Ruby
  2. file_to_open = "c:pathtofile.txt"
  3. system %{cmd /c "start #{file_to_open}"}
  4.        
  5. file_to_open = "/path/to/file.txt"
  6. system %{open "#{file_to_open}"}