00001 /* 00002 * This file is part of liberscribble. 00003 * 00004 * liberscribble is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * liberscribble is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00024 #include <string.h> 00025 #include <sys/stat.h> 00026 00027 #include "scbpath.h" 00028 00029 00030 void scb_path_init(ScbPathPtr ptr) 00031 { 00032 if (ptr) 00033 { 00034 memset(ptr, 0, sizeof(ScbPath)); 00035 } 00036 } 00037 00038 00039 gboolean scb_path_file_exist(const char *pathName) 00040 { 00041 struct stat statbuf; 00042 if (0 != stat(pathName, &statbuf)) 00043 { 00044 return FALSE; 00045 } 00046 if (S_ISREG(statbuf.st_mode)) 00047 { 00048 return TRUE; 00049 } 00050 return FALSE; 00051 }
1.5.6