On Wed 12 Feb 2025 at 17:52:38 (+0100), SK wrote:
> since a few days I cannot use a script involving lilypond-book anymore.
> It's really strange cause I don't remember to change anything for the
> script, the included python or lilypond itself. Only thing I did was
> cleaning up the output directory by deleting old files - as far as I
> understand this should not change the behaviour of the script.
> I'm on Windows 10, lilypond 2.24.4

On Thu 13 Feb 2025 at 18:07:00 (+0100), SK wrote:
> Hello, thank you for your answer. I will post the output using debug as
> soon as I'm back on the computer. However, I noticed the following
> yesterday: If I change the output directory of my command to, say,
> "D:\test", it runs and generates the .tex files. "test" didn't exist
> before. But, deleting my original output directory and running the command
> again fails with the same error. I would suspect some problems with the
> long path, but I know it worked before without actually changing anything
> on lilypond.

As the files in the output directory are ephemeral, and you say you're
running a script, I would work around the problem by generating a
pseudorandom temporary directory name, but which monotonically
increases with time (so you can tell the order of creation). I'd use
something like "/tmp/$USER-lilybook$(date +%s)" in linux, where date
is giving the number of seconds since the epoch. (If I were firing off
multiple commands at high speed, I'd include nanoseconds, with +%s%N .)
At the end, the script could move the PDF output from the --output
directory to be with .\book_general.lytex, as .\book_general.pdf .
The result should be much shorter paths for the data files.

Cheers,
David.

Reply via email to