POV-Ray : Newsgroups : povray.bugreports : #write : Re: #write Server Time
4 May 2024 17:29:00 EDT (-0400)
  Re: #write  
From: Le Forgeron
Date: 3 Mar 2016 07:09:22
Message: <56d82972$1@news.povray.org>
Le 02/03/2016 11:15, clipka a écrit :
> Am 01.03.2016 um 23:08 schrieb Le_Forgeron:
>
>> ab-using code like
>> #write( .... #write( ...
>> is a call for lightning from Zeus and the opening of the multidimensional portal
for Chtulhu.
>
> Actually - no. There's no abuse in there /per se/. The nested `#write`
> might be part of a macro invocation, such as in:
>
> #write(File,SomeMacro())
>
> where `SomeMacro` might be part of a 3rd party include file that itself
> makes heavy use of file operations, e.g. to persist some random number
> generator's state across frames or the like.

Ok, a counter cannot be used, but I hope you would agree that performing 
a write in a write *on the same file* is a bug.

Which mean the protection mechanism could be a (static) container of 
file (descriptor), push on entry of write as soon as value is parsed, 
popped on exit of write. And just before the push, search the container 
if already present... unless the container performs that check during 
the push for us.

Same goes for read during a read *on the same file*.

Or do you see a legit usage for such perversion ?


Post a reply to this message

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