POV-Ray : Newsgroups : povray.bugreports : file write fail ignored : file write fail ignored Server Time
4 May 2024 00:01:47 EDT (-0400)
  file write fail ignored  
From: jr
Date: 6 Oct 2021 05:05:00
Message: <web.615d65f43a5df4635bd1b3ba6cde94f1@news.povray.org>
hi,

-----<snip>-----
#version 3.8;

global_settings {assumed_gamma 1}
box {0,1}

#if (0)
#declare dir_ = "/badName/";
#else
#declare dir_ = "/tmp/";
#end

#declare arr_ = array [3] {"foo","bar","baz"};

#fopen fp_ concat(dir_,"wtest.txt") write

#for (i_,0,2)
  #if (2 != i_) #local c_ = ","; #else #local c_ = ""; #end
  #write (fp_,concat("\"",arr_[i_],"\"",c_))
#end

#fclose fp_
-----<snip>-----

when I change the '#if' to use a non-existing directory, the alpha.9945627 and
beta.2, as well as WFP's povr, all silently ignore the fact that no file was
(could be) created, and do not return an error.  both on Linux and Windows.

(thanks for the discovery goes to TdG who ran into this issue while testing some
code of mine)


regards, jr.


Post a reply to this message

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