POV-Ray : Newsgroups : povray.beta-test : Stream <type>_file=false ini options not working. Server Time
28 Apr 2024 17:01:31 EDT (-0400)
  Stream <type>_file=false ini options not working. (Message 1 to 4 of 4)  
From: William F Pokorny
Subject: Stream <type>_file=false ini options not working.
Date: 1 Mar 2024 09:58:07
Message: <65e1ecff$1@news.povray.org>
It looks like these options have not functioned correctly since at least 
v3.7.

I have not yet fixed them the yuqk fork - the fix priority is low.

The options in particular are:

all_file=false
debug_file=false
fatal_file=false
render_file=false
statistic_file=false

Bill P.


Post a reply to this message

From: Thorsten
Subject: Re: Stream <type>_file=false ini options not working.
Date: 1 Mar 2024 13:32:24
Message: <65e21f38$1@news.povray.org>
On 01.03.2024 15:58, William F Pokorny wrote:
> It looks like these options have not functioned correctly since at least 
> v3.7.
> 
> I have not yet fixed them the yuqk fork - the fix priority is low.
> 
> The options in particular are:
> 
> all_file=false
> debug_file=false
> fatal_file=false
> render_file=false
> statistic_file=false

I think this is more a documentation error remaining than a missing 
feature. All this would do is turn OFF output to a file, which already 
will only be written if it is specified in the first place ... what does 
work is setting this to an empty string.

However, if you wanted to implement "false" it, it should be in 
frontend/renderfrontend.cpp method RenderFrontendBase::CreateScene

Find the line
if(ProcessOptions::IsTrue(UCS2toSysString(shd.streamnames[gStreamNumber[i]]).c_str()) 
== true)

and add a case for IsFalse that sets the 
shd.streamnames[gStreamNumber[i]] to an empty string.

Thorsten


Post a reply to this message

From: William F Pokorny
Subject: Re: Stream <type>_file=false ini options not working.
Date: 2 Mar 2024 09:39:50
Message: <65e33a36$1@news.povray.org>
On 3/1/24 13:32, Thorsten wrote:
> I think this is more a documentation error remaining than a missing 
> feature. All this would do is turn OFF output to a file, which already 
> will only be written if it is specified in the first place ... what does 
> work is setting this to an empty string.
> 
> However, if you wanted to implement "false" it, it should be in 
> frontend/renderfrontend.cpp method RenderFrontendBase::CreateScene
> 
> Find the line
>
if(ProcessOptions::IsTrue(UCS2toSysString(shd.streamnames[gStreamNumber[i]]).c_str())
== true)
> 
> and add a case for IsFalse that sets the 
> shd.streamnames[gStreamNumber[i]] to an empty string.

Thank you, Thorsten, for digging.

Unfortunately, your suggestion to try the empty string highlights a 
secondary bug. All of the variations below direct the stream to a 
defaulted filename of debug.out in my testing (ini forms too).

yuqk debug.pov debug_file=on
yuqk debug.pov debug_file=true
yuqk debug.pov debug_file=yes
yuqk debug.pov debug_file=1
yuqk debug.pov debug_file=
yuqk debug.pov debug_file=""
yuqk debug.pov debug_file=''

The secondary problem is ProcessOptions::IsTrue (and 
uProcessOptions::IsFalse) use ProcessOptions::Matches which needs the 
following code at the very top

    if ( ((v2[0] == 0) || (v1[0] == 0)) &&
        !((v2[0] == 0) && (v1[0] == 0)))
    {
        return false;
    }

to not, falsely, test 'true' on empty string options. With that 
secondary fix in place, the following code is testing out OK for me. 
(Ugly code formatting to avoid uglier formatting on posting of code...)

Replace:

     shd.streamnames[gStreamNumber[i]] =
         obj.GetUCS2String(gStreamTypeUtilData[i]);
     if (ProcessOptions::IsTrue(
         UCS2toSysString(shd.streamnames[gStreamNumber[i]]).c_str()
         ) == true)
         shd.streamnames[gStreamNumber[i]] =
         SysToUCS2String(gStreamDefaultFile[i]);

With:

     if (ProcessOptions::IsTrue(
         UCS2toSysString(
             obj.GetUCS2String(gStreamTypeUtilData[i])
         ).c_str()) == true)
     {
         shd.streamnames[gStreamNumber[i]] =
             SysToUCS2String(gStreamDefaultFile[i]);
     }
     else if (ProcessOptions::IsFalse(
         UCS2toSysString(
             obj.GetUCS2String(gStreamTypeUtilData[i])
         ).c_str()) == true)
     {
         // Do nothing if the string indicates false (or empty).
     }
     else
     {
         shd.streamnames[gStreamNumber[i]] =
             obj.GetUCS2String(gStreamTypeUtilData[i]);
     }

Bill P.


Post a reply to this message

From: Thorsten
Subject: Re: Stream <type>_file=false ini options not working.
Date: 2 Mar 2024 11:34:49
Message: <65e35529@news.povray.org>
On 02.03.2024 15:39, William F Pokorny wrote:
 > The secondary problem is ProcessOptions::IsTrue (and
 > uProcessOptions::IsFalse) use ProcessOptions::Matches which needs the
 > following code at the very top
 >
 >     if ( ((v2[0] == 0) || (v1[0] == 0)) &&
 >         !((v2[0] == 0) && (v1[0] == 0)))
 >     {
 >         return false;
 >     }
 >
 > to not, falsely, test 'true' on empty string options.
Interesting. Then I am not sure this ever worked as documented before in 
the first place: The matches-code is a straight port from 3.1 and 
according to the header there dates back to April 1994. So you probably 
found a 30 year old bug here ...

Thorsten


Post a reply to this message

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