--- parser3/src/classes/file.C 2001/03/19 20:46:35 1.2 +++ parser3/src/classes/file.C 2001/03/24 15:57:57 1.6 @@ -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.2 2001/03/19 20:46:35 paf Exp $ + $Id: file.C,v 1.6 2001/03/24 15:57:57 paf Exp $ */ #include "pa_request.h" @@ -12,27 +12,29 @@ // global var -VStateless_class *file_base_class; +VStateless_class *file_class; // methods static void _save(Request& r, const String& method_name, Array *params) { - //\Pool& pool=r.pool(); + Pool& pool=r.pool(); Value *vfile_name=static_cast(params->get(0)); // forcing - // ^save{this body type} - r.fail_if_junction_(false, *vfile_name, method_name, "file name must be junction"); - - { - Temp_lang temp_lang(r, String::Untaint_lang::FILE); - static_cast(r.self)->save( - r.absolute(r.process(*vfile_name).as_string().cstr())); - } + // ^save[this body type] + r.fail_if_junction_(true, *vfile_name, + method_name, "file name must not be junction"); + + // forcing untaint language + String lfile_name(pool); + lfile_name.append(vfile_name->as_string(), + String::UL_FILE_NAME, true); + + static_cast(r.self)->save(r.absolute(lfile_name)); } // 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); }