jed-users mailing list

[2014 Date Index] [2014 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [jed-users] catch output from pipe_region?


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]