X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsupport%2Ffilefuncs.cpp;fp=libctsupport%2Ffilefuncs.cpp;h=0000000000000000000000000000000000000000;hp=ab26634563b5e336a97b60ed8779d9643addf32f;hb=3e346e67f7f7a331919a32439b0f54a4d53d3029;hpb=949b7c917af311cd38f911bc5d0af36f524a6086 diff --git a/libctsupport/filefuncs.cpp b/libctsupport/filefuncs.cpp deleted file mode 100644 index ab26634..0000000 --- a/libctsupport/filefuncs.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/***************************************************************************** -** This is part of the CTSim program -** Copyright (C) 1983-2000 Kevin Rosenberg -** -** $Id: filefuncs.cpp,v 1.3 2000/06/22 10:17:28 kevin Exp $ -** -** Revision 1.1.1.1 2000/04/28 13:02:44 kevin -** Initial CVS import for first public release -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License (version 2) as -** published by the Free Software Foundation. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -******************************************************************************/ - -#include -#include -#include -#include -#include "ctsupport.h" - - -const char* -fileBasename (const char* const filename) -{ - const char* p = strrchr (filename, '/'); - return (p ? p + 1 : filename); -} - - -/* NAME - * fileExists Checks if a specified disk fie exists - * - * SYNOPSIS - * exist = fileExists (fname) - * bool exist TRUE if specified file exists - */ - -bool -fileExists (const char *fname) -{ - FILE *fp; - bool exist; - - if (strlen(fname) == 0) - exist = false; - else if ((fp = fopen(fname, "r")) == NULL) - exist = false; - else { - fclose (fp); - exist = true; - } - - return (exist); -} -