lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Read multiple lines from an input-pipe


From: David Kastrup
Subject: Re: Read multiple lines from an input-pipe
Date: Tue, 29 Apr 2014 12:42:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> Hi all,
>
> I'm writing a set of functions to retrieve Git repository information
> for use in a score:
> https://github.com/openlilylib/snippets/tree/master/editorial-tools/git-commands
>
> I'm using a function provided by Lars Haulin in a comment to a blog
> post that is essentially the one for open-input-pipe given here:
> https://www.gnu.org/software/guile/manual/html_node/Pipes.html
>
> In addition to what is already there I want to write commands that use
> more than one line of the Git commands' output (e.g. print the whole
> commit message).
> How would I approach that in Scheme?
> What I need is for example a list of all strings that the command outputs.
> Do I have to write some kind of loop while the pipe is open?
> Or is there a way to get the whole output as one string or a list of
> strings?

<URL:https://www.gnu.org/software/guile/manual/html_node/Block-Reading-and-Writing.html#Block-Reading-and-Writing>

And splitting a string on delimiters like newline should also be
reasonably easy if you need that.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]