POV-Ray : Newsgroups : povray.general : Determine if File Exists? Server Time
19 May 2024 21:21:48 EDT (-0400)
  Determine if File Exists? (Message 1 to 5 of 5)  
From: Chris S 
Subject: Determine if File Exists?
Date: 7 Sep 2004 13:31:49
Message: <413df085$1@news.povray.org>
How would you determine if a file exists? The docs list 
#fopen/read/write/fclose, but not any other file IO functions. Is this 
possible with POVRay?


Post a reply to this message

From: Slime
Subject: Re: Determine if File Exists?
Date: 7 Sep 2004 15:58:56
Message: <413e1300$1@news.povray.org>
> How would you determine if a file exists? The docs list
> #fopen/read/write/fclose, but not any other file IO functions. Is this
> possible with POVRay?

From "3.2.2.3.1  The #fopen Directive": You may use #ifdef
FILE_HANDLE_IDENTIFIER to see if a file is open.

So I think using #fopen to open the file, and then using #ifdef on the file
handle identifier will check if the file exists.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Christoph Hormann
Subject: Re: Determine if File Exists?
Date: 7 Sep 2004 16:25:02
Message: <chl5bn$rvd$1@chho.imagico.de>
Chris S. wrote:
> How would you determine if a file exists? The docs list 
> #fopen/read/write/fclose, but not any other file IO functions. Is this 
> possible with POVRay?

http://www.povray.org/documentation/view/3.6.1/228/#s02_02_01_03_04_i20

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 06 Jul. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Warp
Subject: Re: Determine if File Exists?
Date: 7 Sep 2004 16:37:01
Message: <413e1bed@news.povray.org>
Chris S. <chr### [at] nospamudeledu> wrote:
> How would you determine if a file exists?

  file_exists("filename")

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Chris S 
Subject: Re: Determine if File Exists?
Date: 7 Sep 2004 16:46:38
Message: <413e1e2e$1@news.povray.org>
Christoph Hormann wrote:

> Chris S. wrote:
> 
>> How would you determine if a file exists? The docs list 
>> #fopen/read/write/fclose, but not any other file IO functions. Is this 
>> possible with POVRay?
> 
> 
> http://www.povray.org/documentation/view/3.6.1/228/#s02_02_01_03_04_i20
> 
> Christoph

Thank you. That's exactly what I'm looking for.


Post a reply to this message

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