Browse Subversion Repository
Contents of /common/ExistFile.cpp
Parent Directory
| Revision Log
Revision 290 -
( show annotations)
( download)
( as text)
Tue Mar 18 06:43:15 2008 UTC
(16 years, 2 months ago)
by satofumi
File MIME type: text/x-c++src
File size: 470 byte(s)
Mac 用の調整
| 1 |
/*! |
| 2 |
\file |
| 3 |
\brief ファイル有無の確認 |
| 4 |
|
| 5 |
access() のラッパー |
| 6 |
|
| 7 |
\author Satofumi KAMIMURA |
| 8 |
*/ |
| 9 |
|
| 10 |
#include "ExistFile.h" |
| 11 |
#include "DetectOS.h" |
| 12 |
#if defined(LINUX_OS) || defined(Cygwin) || defined(MAC_OS) |
| 13 |
#include <unistd.h> |
| 14 |
#else |
| 15 |
#include <windows.h> |
| 16 |
#include <direct.h> |
| 17 |
#include <io.h> |
| 18 |
#ifndef F_OK |
| 19 |
#define F_OK 06 |
| 20 |
#endif |
| 21 |
#ifndef W_OK |
| 22 |
#define W_OK 06 |
| 23 |
#endif |
| 24 |
#endif |
| 25 |
|
| 26 |
|
| 27 |
bool beego::existFile(const char* file_path) { |
| 28 |
return (access(file_path, F_OK) == 0) ? true : false; |
| 29 |
} |
|