- Subject: Re: [jed-users] catch output from pipe_region?
- From: jed@xxxxxxxxxxx (John E. Davis)
- Date: Wed, 16 Apr 2014 20:45:48 -0400
Ulli Horlacher <framstag@xxxxxxxxxxxxxxxxxxxx> wrote:
> I need the md5sum of the current buffer.
> With pipe_region() I can send the buffer contents to the external md5sum
> command, but how can I catch its output (without writing it into a file)?
If you have slang pre2.3.0-4 or later, you can use its checksum
module. For example, here is a function that returns the md5sum of
the current buffer:
require ("chksum");
define md5sum_buffer ()
{
variable c = md5sum_new ();
push_spot ();
mark_buffer ();
c.accumulate (bufsubstr ());
pop_spot();
return c.close ();
}
--John
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
[2014 date index]
[2014 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]