|
|
| version 1.243, 2008/05/27 19:01:46 | version 1.246, 2008/09/03 14:29:17 |
|---|---|
| Line 451 static void _save(Request& r, MethodPara | Line 451 static void _save(Request& r, MethodPara |
| --param_index; | --param_index; |
| const String& file_name=params.as_string(param_index++, FILE_NAME_MUST_NOT_BE_CODE); | const String& file_name=params.as_string(param_index++, FILE_NAME_MUST_NOT_BE_CODE); |
| String file_spec=r.absolute(file_name); | |
| if(do_append && file_exist(file_spec)) | |
| output_column_names=false; | |
| TableSeparators separators; | TableSeparators separators; |
| if(param_index<params.count()) { | if(param_index<params.count()) { |
| Line 515 static void _save(Request& r, MethodPara | Line 519 static void _save(Request& r, MethodPara |
| // write | // write |
| { | { |
| const char* data_cstr=sdata.cstr(); | const char* data_cstr=sdata.cstr(); |
| file_write(r.absolute(file_name), | file_write(file_spec, |
| data_cstr, sdata.length(), true, do_append); | data_cstr, sdata.length(), true, do_append); |
| if(*data_cstr) // not empty (when empty it's not heap memory) | if(*data_cstr) // not empty (when empty it's not heap memory) |
| pa_free((void*)data_cstr); // not needed anymore | pa_free((void*)data_cstr); // not needed anymore |
| Line 566 static void _save(Request& r, MethodPara | Line 570 static void _save(Request& r, MethodPara |
| // write | // write |
| { | { |
| string data=ost.str(); | string data=ost.str(); |
| const char* data_cstr = data.c_str(); | const char* data_cstr=data.c_str(); |
| file_write(r.absolute(file_name), data_cstr, data.length(), true /* as text */, do_append); | file_write(file_spec, data_cstr, data.length(), true /* as text */, do_append); |
| } | } |
| #endif | #endif |
| Line 1117 static void _sql(Request& r, MethodParam | Line 1121 static void _sql(Request& r, MethodParam |
| Value& statement=params.as_junction(0, "statement must be code"); | Value& statement=params.as_junction(0, "statement must be code"); |
| HashStringValue* bind=0; | HashStringValue* bind=0; |
| ulong limit=0; | ulong limit=SQL_NO_LIMIT; |
| ulong offset=0; | ulong offset=0; |
| if(params.count()>1) { | if(params.count()>1) { |
| Value& voptions=params.as_no_junction(1, "options must be hash, not code"); | Value& voptions=params.as_no_junction(1, "options must be hash, not code"); |