CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

how to check the existence of a file

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   October 12, 2011, 09:04
Default how to check the existence of a file
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, 03:39
Senior Member
Join Date: Mar 2009
Posts: 133
Rep Power: 10
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.

coglione is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 16:02
wmake compiling new solver mksca OpenFOAM Programming & Development 13 August 18, 2014 22:26
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 03:01
ParaView Compilation jakaranda OpenFOAM Installation 3 October 27, 2008 12:46

All times are GMT -4. The time now is 19:56.