function value = file_exist ( file_name ) %*****************************************************************************80 % %% FILE_EXIST reports whether a file exists. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 29 October 2004 % % Author: % % John Burkardt % % Parameters: % % Input, character FILE_NAME, the name of the file. % % Output, logical FILE_EXIST, is TRUE if the file exists. % fid = fopen ( file_name ); if ( fid == -1 ) value = 0; else fclose ( fid ); value = 1; end return end