|
|
On 7/10/2019 4:15 PM, jr wrote:
> hi,
>
> Mike Horvath <mik### [at] gmailcom> wrote:
>> On 7/10/2019 3:44 PM, Mike Horvath wrote:
>>> Normally POV-Ray quits with an error if it tries to load an include file
>>> but it is missing. Is there a way to spawn a warning when this happens,
>>> and continue with the render? I am trying to track whether this happens
>>> within a project I am working on, and can't think of a better method.
>>> Thanks.
>>
>> I found this in the docs.
>> file_exists(S)
>> Attempts to open the file specified by the string S. The current
>> directory and all library directories specified by the Library_Path
>> or +L options are also searched. See Library Paths for details.
>> Returns 1 if successful and 0 if unsuccessful.
>>
>> But it only works if you know the name of the file beforehand. I am
>> testing other people's code and there are about 1000 files to check...
>
> with so many files to check, it might be easier to use tools provided by the
> system, eg
> $ grep '^#include' /path/to/files/* > todo-list
>
> to get a list of all .inc files. then you can check either check for their
> existence or create dummy files (with only a '#debug
> concat("missing-name.inc")'.
>
> (nb the expression given to grep would need to allow for leading and
> intermediate spaces)
>
>
> regards, jr.
>
>
That is a good idea, thanks.
Michael
Post a reply to this message
|
|