lilypond-user
[Top][All Lists]
Advanced

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

Re: Include a file if it exists


From: Jim Long
Subject: Re: Include a file if it exists
Date: Mon, 8 Sep 2014 17:35:56 -0700
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Sep 08, 2014 at 11:14:34PM +0200, Gilles THIBAULT wrote:
> 
> \version "2.18.2"
> 
> file = #(let((myfile "test.ly"))
> (if (file-exists? myfile)
>        myfile
>        "emptyfile.ly"))
> 
> \include #file
> 
> %%%%%%%%%
> 
> which seems to works, but you need to create an empty file "emptyfile.ly" 
> somewhere in your PATH.
> Alternatively, this seems also to work :
> 
> ...
> (if (file-exists? myfile)
>        myfile
>        ""))
> 
> but you will get an advertisement for the \include ""

/dev/null works as an include filename, also, although it's
probably rather more OS-specific than "emptyfile.ly".






reply via email to

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