save. Saving file to disk

^some_file.save[format;filename]
^some_file.save[format;
filename;options]   [3.4.0]

Method saves object to file in specified format and with specified name.

format-format of saving file (text or binary)
filename-name of file and path for the file to be saved

Options hash can be specified:
·$.charset[charset] - charset of saving text file.  
·$.append(false/true) - if the file with specified filename exists, append to it. By default, if the file with specified filename exists, it will be overwrited.   [3.4.6]  

Example
^archive.save[text;/arch/archive.txt]

This code will save object of class
file as archive.txt in text format to directory /arch/.


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 26.01.2021