On Thu 04 Jan 2024 at 23:34:28 (+0100), Volodymyr Prokopyuk wrote: > > I know that lilypond can receive a source.ly file from the stdin by > using lilypond > -. Is it possible for lilypond to output PDF to the stdout? > > My motivation behind using lilypond in a pipeline is to speed up PDF > generation by avoiding storing intermediary files on disk. The pipeline I'd > like to implement is > cat source.ly | lintLy | lilypond - | optimizePDF > score.pdf > Currently lilypond engraves PDF on disk, so a PDF optimizer has to read, > optimize, and substitute PDF on disk.
You could create a RAM disk to hold your intermediate files, something along the lines of: Ramdir="/dev/shm/${FUNCNAME[0]}$(printf '%(%s)T' -1)" $ mkdir -p "$Ramdir" The first line (which I run in a bash function, for a quite different purpose) creates a pseudounique but recognizable name, and the second line creates the directory. Cheers, David.