--- parser3/src/classes/file.C 2001/03/19 20:08:12 1.1 +++ parser3/src/classes/file.C 2001/03/19 21:39:30 1.3 @@ -3,7 +3,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: file.C,v 1.1 2001/03/19 20:08:12 paf Exp $ + $Id: file.C,v 1.3 2001/03/19 21:39:30 paf Exp $ */ #include "pa_request.h" @@ -12,7 +12,7 @@ // global var -VStateless_class *file_base_class; +VStateless_class *file_class; // methods @@ -20,16 +20,19 @@ static void _save(Request& r, const Stri //\Pool& pool=r.pool(); Value *vfile_name=static_cast(params->get(0)); // forcing - // ^save[this body type] - r.fail_if_junction_(true, *vfile_name, - method_name, "file name must not be junction"); + // ^save{this body type} + r.fail_if_junction_(false, *vfile_name, method_name, "file name must be junction"); - static_cast(r.self)->save(r.absolute(vfile_name->as_string().cstr())); + { + Temp_lang temp_lang(r, String::Untaint_lang::FILE); + static_cast(r.self)->save( + r.absolute(r.process(*vfile_name).as_string().cstr())); + } } // initialize -void initialize_file_base_class(Pool& pool, VStateless_class& vclass) { +void initialize_file_class(Pool& pool, VStateless_class& vclass) { // ^save[file-name] vclass.add_native_method("save", _save, 1, 1); }