Re: [MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Louis-Philippe
Done, >From now on I will absolutely report any segfault, with pleasure! 2010/11/3 Laurent Sansonetti > Hi Louis-Philippe, > > MacRuby should never segfault, as others indicated here. Please help us by > filing a ticket each time you can reproduce a segfault and we will triage / > duplicate the

Re: [MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Laurent Sansonetti
Hi Louis-Philippe, MacRuby should never segfault, as others indicated here. Please help us by filing a ticket each time you can reproduce a segfault and we will triage / duplicate the reports accordingly. Thanks in advance :) Laurent On Nov 3, 2010, at 10:46 AM, Louis-Philippe wrote: > Total

Re: [MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Perry E. Metzger
On Wed, 3 Nov 2010 13:46:24 -0400 Louis-Philippe wrote: > Totally agree Rob... but right now it seems it does segfault on > occasions and I think some serious bugs affecting functionalities > and RubySpecs are still in the bugbase and I wouldn't like to > dissolve those priorities with more excep

Re: [MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Louis-Philippe
Totally agree Rob... but right now it seems it does segfault on occasions and I think some serious bugs affecting functionalities and RubySpecs are still in the bugbase and I wouldn't like to dissolve those priorities with more exception handling error... I may not understand how important this se

Re: [MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Rob Gleeson
I think you should still file a bug report -- MacRuby should never ever segfault :) ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Re: [MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Louis-Philippe
Great! Thanks all for the answers! I would have really liked to use backticks or open3, as they are really easier to use, but what my example didn't show is that my subprocess will be interactive, so in that case NSTask really seems like the way to go. For NSTask segfault, you were right, it was

Re: [MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Matt Aimonetti
I have to respectfully agree that open3 is easier to use, however it doesn't offer some of the more advanced features offered by NSTask. I also found out why you are seeing a segfault, the arguments should be passed in an array, try: framework "foundation" task = NSTask.launchedTaskWithLaunchPath

Re: [MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Matt Massicotte
I respectfully disagree :) NSTask is a huge pain and will result in dramatically more code in the simple cases. Open3 is much easier to work with, and we can only dream of a solution as simple as backticks in Cocoa. It becomes less of an issue if you are executing long-running processes and d

Re: [MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Rob Gleeson
fork() is not implemented in MacRuby, and I don't think it will be implemented anytime in the near future because of conflicts with the CoreFoundation framework and the Garbage Collector (as I understand it). The same is true for Objective-C applications. NSTask is definitely the way to go, bu

Re: [MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Matt Massicotte
Open3 works correctly for me. I've had tons of problems in the past using Open3 (in ruby) with interactive commands. I think the problem is that you are trying to run irb. The following works for me. Open3.popen3('ls') { |stdin,stdout,stderr| puts stdout.readlines } Backticks work as well, b

Re: [MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Matt Aimonetti
NSTask is the way to go, I used it in many cases, including some examples in my O'Reilly book: http://macruby.labs.oreilly.com/ch04.html#_tasks_subprocesses You can also look at this more complex example: https://github.com/mattetti/couchdbx-app/tree/master/macruby_version/CouchDBX/ The wrapper

[MacRuby-devel] MacRuby with Subprocesses

2010-11-03 Thread Louis-Philippe
Hi all, I'm looking around MacRuby to find a way to run a subprocess and monitor it, here is what I tried: NSTask: framework "foundation" task = NSTask.launchedTaskWithLaunchPath("/bin/ls", arguments:"-l") p task.isRunning p task.standardOutput => Segmentation fault Open4: require 'rubygems'