POV-Ray : Newsgroups : povray.advanced-users : Check for missing include files? : Re: Check for missing include files? Server Time
24 Feb 2024 17:16:53 EST (-0500)
  Re: Check for missing include files?  
From: jr
Date: 10 Jul 2019 16:20:01
Message: <web.5d26476bdfe125153936914a0@news.povray.org>
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.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.