1 /*****************************************************************************
2 ** This is part of the CTSim program
3 ** Copyright (C) 1983-2000 Kevin Rosenberg
5 ** $Id: filefuncs.cpp,v 1.3 2000/06/22 10:17:28 kevin Exp $
7 ** Revision 1.1.1.1 2000/04/28 13:02:44 kevin
8 ** Initial CVS import for first public release
10 ** This program is free software; you can redistribute it and/or modify
11 ** it under the terms of the GNU General Public License (version 2) as
12 ** published by the Free Software Foundation.
14 ** This program is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ** GNU General Public License for more details.
19 ** You should have received a copy of the GNU General Public License
20 ** along with this program; if not, write to the Free Software
21 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 ******************************************************************************/
29 #include "ctsupport.h"
33 fileBasename (const char* const filename)
35 const char* p = strrchr (filename, '/');
36 return (p ? p + 1 : filename);
41 * fileExists Checks if a specified disk fie exists
44 * exist = fileExists (fname)
45 * bool exist TRUE if specified file exists
49 fileExists (const char *fname)
54 if (strlen(fname) == 0)
56 else if ((fp = fopen(fname, "r")) == NULL)