--- parser3/src/main/pa_common.C 2001/04/03 07:32:46 1.37 +++ parser3/src/main/pa_common.C 2001/04/03 17:01:03 1.39 @@ -6,7 +6,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_common.C,v 1.37 2001/04/03 07:32:46 paf Exp $ + $Id: pa_common.C,v 1.39 2001/04/03 17:01:03 paf Exp $ */ #include "pa_config_includes.h" @@ -53,7 +53,7 @@ char *file_read_text(Pool& pool, const S bool file_read(Pool& pool, const String& file_spec, void*& data, size_t& size, bool as_text, bool fail_on_read_problem) { - char *fname=file_spec.cstr(); + char *fname=file_spec.cstr(String::UL_FILE_NAME); int f; struct stat finfo; @@ -94,12 +94,13 @@ bool file_read(Pool& pool, const String& return false; } +/// @test mkdirs void file_write(Pool& pool, const String& file_spec, const void *data, size_t size, bool as_text/*, bool exclusive*/) { - char *fname=file_spec.cstr(); + char *fname=file_spec.cstr(String::UL_FILE_NAME); int f; if(access(fname, F_OK)!=0) {/*no*/ if((f=open(fname, O_WRONLY|O_CREAT|_O_BINARY, 0666))>0) @@ -131,14 +132,14 @@ void file_write(Pool& pool, } void file_delete(Pool& pool, const String& file_spec) { - if(unlink(file_spec.cstr())!=0) + if(unlink(file_spec.cstr(String::UL_FILE_NAME))!=0) PTHROW(0, 0, &file_spec, "unlink failed: %s (#%d)", strerror(errno), errno); } bool file_readable(const String& file_spec) { - return access(file_spec.cstr(), R_OK)==0; + return access(file_spec.cstr(String::UL_FILE_NAME), R_OK)==0; } char *getrow(char **row_ref, char delim) { @@ -260,7 +261,8 @@ static void append_attribute_subattribut // ...; charset=windows1251 String *string=static_cast(info); - string->APPEND_CONST("; "); + if(string->size()) + string->APPEND_CONST("; "); string->append(akey, String::UL_HEADER, true); string->APPEND_CONST("="); string->append(static_cast(avalue)->as_string(),