Chameleon Applications

Chameleon Applications Svn Source Tree

Root/branches/ErmaC/ChameleonPrefPane/Sources/file_util.h

1/*
2 * file_util.h
3 * ChameleonPrefPane
4 *
5 * Created by Rekursor on 1/24/10.
6 *
7 */
8#ifndef __CHFILE_UTIL_H
9#define __CHFILE_UTIL_H
10#include <sys/stat.h>
11#include <string>
12
13/**
14 * Check whether file exists:
15 */
16inline bool fileExists(const char * str)
17{
18struct stat stFileInfo;
19if((stat(str,&stFileInfo)) == 0) return true;
20else return false;
21}
22
23inline bool fileExists(std::string str) {return fileExists(str.c_str());}
24
25
26#endif
27

Archive Download this file

Revision: 396