CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

how to check the existence of a file

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 12, 2011, 10:04
Default how to check the existence of a file
  #1
New Member
 
tang jian hua
Join Date: May 2011
Posts: 2
Rep Power: 0
jht529100 is on a distinguished road
dear guys:
i recently write a udf,in order to check the existence of one file,i used the access function,(if (access(filename,0)==0).it works in vs-2005,but when i compile it in fluent,the error occur and it can't be compiled,any hints may help,thanks!
jht529100 is offline   Reply With Quote

Old   October 13, 2011, 04:39
Default
  #2
Senior Member
 
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17
coglione is on a distinguished road
File *output_file;
if (!(output_file = fopen(filename,"r")))
Error("unable to open file");

checks wether a file "filename" can be opened or not.

cheers
coglione is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
wmake compiling new solver mksca OpenFOAM Programming & Development 14 June 22, 2018 07:29
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 17:02
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 18:18
critical error during installation of openfoam Fabio88 OpenFOAM Installation 21 June 2, 2010 04:01
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 12:46


All times are GMT -4. The time now is 21:48.