Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: marcus-sup@bar-coded.net (Marcus Williams)
Subject: [sup-talk] [PATCH] Pipe message/attachement to shell command
Date: Wed, 14 Nov 2007 09:40:23 +0000	[thread overview]
Message-ID: <1195032303-sup-7083@tomsk> (raw)
In-Reply-To: <1194955037-sup-614@tomsk>

On 13.11.2007, Marcus Williams wrote:
> Mmmm. Seem to be having some buffering problems with open3 on slightly
> longer messages. The pipe stuff blocks because of it.
> 
> Will have to resubmit when I figure it out.

Ok, heres the new one. I think in the pipe to command case, the
session gem is probably the best way to go (although I've not use it
here) because it handles the blocking problems for you.

This patch will:

* return an error correctly if the command returns an error initially
(like a usage error, or missing file etc)
* pipes the mail/attachment to the command
* read either stdout OR stderr, whichever is ready first and display that.

The last step is where the problem lies. If a command produces both I
cant figure out what to do with it, should it display two separate
buffers, one with errors and one with output? What happens if the
context of the error is important (ie where it is in the output
stream)?

I'm pretty sure this is an edge case, as the majority of usages of
this would be to pipe through a spam filter, or a file viewer (like
textviewer.sh from claws mail or antiword) and this patch works fine
in those cases.

Anyone any comments?

Marcus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: open3-diffs
Type: application/octet-stream
Size: 3524 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20071114/5d29ac10/attachment.obj 


  reply	other threads:[~2007-11-14  9:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-09 15:33 Marcus Williams
2007-11-12 17:55 ` William Morgan
2007-11-12 22:06   ` Marcus Williams
2007-11-13 11:58     ` Marcus Williams
2007-11-14  9:40       ` Marcus Williams [this message]
2007-11-26 20:57         ` Marcus Williams
2007-11-26 21:01           ` Marcus Williams
2007-12-10  6:24             ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1195032303-sup-7083@tomsk \
    --to=marcus-sup@bar-coded.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox