[TxMt] tm_dialog and really long plists

James Edward Gray II james at grayproductions.net
Thu Apr 26 19:13:47 UTC 2007


On Apr 26, 2007, at 2:05 PM, Allan Odgaard wrote:

> On 26. Apr 2007, at 15:12, Brett Terpstra wrote:
>
>> I had been setting a variable to the open() command, but I think  
>> that it returns nil, doesn't it?  How do I get the return value  
>> from the dialog into a variable using this method?  Or is that not  
>> the problem...?
>
> When you want to both send and receive stdin/out to/from a command,  
> you need to use popen3.

Is that true?  I thought that's only if we needed stderr too.

> For example like this (untested):
>
>     require "open3"
>
>     Open3.popen3('"$DIALOG" -m select_photoset') do |stdin, stdout,  
> stderr|
>       stdin << plist; stdin.close
>       res = PropertyList::load(stdout)
>     end

What's wrong with:

   IO.popen('"$DIALOG" -m select_photoset') do |dialog|
     dialog << plist
     dialog.close_write
     res = PropertyList::load(dialog)
   end

?

James Edward Gray II



More information about the textmate mailing list