Is it possible to open files (XML, Word) on windows (In the default program)? I am using windows 7 and the latest ruby version (1.9.2).开发者_如何转开发
Try using a "system" call to run the "start" command, like so:
system("start hello.doc") # Should launch MS Word.
system("start file.xml") # Should launch an XML viewer.
If you're wanting your Ruby script to open Word files and manipulate them, then you may want to look into the win32ole library.
精彩评论