--- parser3/src/main/pa_common.C 2001/09/14 15:41:59 1.64 +++ parser3/src/main/pa_common.C 2001/09/21 15:35:45 1.66 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: pa_common.C,v 1.64 2001/09/14 15:41:59 parser Exp $"; +static const char *RCSId="$Id: pa_common.C,v 1.66 2001/09/21 15:35:45 parser Exp $"; #include "pa_common.h" #include "pa_types.h" @@ -203,6 +203,12 @@ bool file_readable(const String& file_sp bool dir_readable(const String& file_spec) { return entry_readable(file_spec, true); } +String *file_readable(const String& path, const String& name) { + String *result=new(path.pool()) String(path); + *result << "/"; + *result << name; + return file_readable(*result)?result:0; +} bool file_executable(const String& file_spec) { return access(file_spec.cstr(String::UL_FILE_SPEC), X_OK)==0; } @@ -218,10 +224,10 @@ bool file_stat(const String& file_spec, struct stat finfo; if(stat(fname, &finfo)!=0) if(fail_on_read_problem) - PTHROW(0, 0, - &file_spec, - "getting file size failed: %s (%d), real filename '%s'", - strerror(errno), errno, fname); + PTHROW(0, 0, + &file_spec, + "getting file size failed: %s (%d), real filename '%s'", + strerror(errno), errno, fname); else return false; rsize=finfo.st_size;