function value = file_exist ( file_name )

%*****************************************************************************80
%
%% file_exist() reports whether a file exists.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    29 October 2004
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    character FILE_NAME, the name of the file.
%
%  Output:
%
%    logical FILE_EXIST: true if the file exists.
%
  fid = fopen ( file_name );

  if ( fid == -1 ) 
    value = false;
  else
    fclose ( fid );
    value = true;
  end

  return
end
