On 13 Jan 2024, at 02:05, Curt McDowell <pla...@fishlet.com> wrote:

Have you actually tried this? LilyPond appends ".pdf" to the output filename (and ".midi"). If you try to make the fifo ending in ".pdf", you find lilypond removes the fifo before writing a new file. For the same reasons, the output file cannot be /dev/stdout. Maybe you could write something exciting using FUSE or Docker.

On 1/7/2024 5:41 AM, Raphael Mankin wrote:
On 05/01/2024 03:46, David Wright wrote:
Alternatively, use a fifo, e.g.

fifo=/var/tmp/ly-pdf$$
rm -rf $fifo
mknod  $fifo p
cat source.ly | lintLy | lilypond -o $fifo &
optimizePDF  < $fifo > score.pdf
wait
rm -rf $fifo

A trick I learned when doing Oracle backups. It also would not write to stdout.

As an offtopic sidenote: even if it worked/works, according to the man-pages of mknod mkfifo should be preferred over mknod to create the FIFO.

"POSIX.1-2001 says: "The only portable use of mknod() is to create a FIFO-special file. If mode is not S_IFIFO or dev is not 0, the behavior of mknod() is unspecified." However, nowadays one should never use mknod() for this purpose; one should use mkfifo(3), a function especially defined for this purpose."

Reply via email to