From: ara.t.howard@... Date: 2006-08-02T05:10:01+09:00 Subject: Re: 'system' and windows and an external program On Wed, 2 Aug 2006 Nuralanur@aol.com wrote: > Dear all, > > I have a Ruby program that does some lengthy calculations and outputs > a matrix, which I'd like to write to a Postscript or PDF using Latex file > for readability > (and re-usability in some lengthier text). > I have managed to put together the Latex code using Ruby, so I can start > Latex using the system command > > system('latex ' + filename[0...filename.index('.')] + '.tex') > > This works. > To turn it into a Postscript file, I need another command > > system('dvips ' + filename[0...filename.index('.')]) > > This works also and creates a new Postscript file. > But now, I'd like to open a Ghostview window to show the output in the > Postscript file automatically from the same Ruby script that did all the > previous work and I'd like Ghostscript to stay open even after the Ruby > program finishes. > > I've tried > system('gsview32 ' + filename[0...filename.index('.')] + '.ps'), ^^^^^ ^^^^^ rindex perhaps? eg does your pathname have two extensions? -a -- we can never obtain peace in the outer world until we make peace with ourselves. - h.h. the 14th dali lama