116 ", %a %b %d %H:%M:%S %Y %Z <")
132 error (
"%s: unable to open input file '%s'", fcn.c_str (), file.c_str ());
133 else if (fcn ==
"save")
134 error (
"%s: unable to open output file '%s'", fcn.c_str (), file.c_str ());
136 error (
"%s: unable to open file '%s'", fcn.c_str (), file.c_str ());
145 bool global,
const std::string& )
161 int num_pat,
const std::string& name)
163 for (
int i = pat_idx; i < num_pat; i++)
167 if (pattern.
match (name))
178 const int magic_len = 10;
179 char magic[magic_len+1];
180 is.read (magic, magic_len);
181 magic[magic_len] =
'\0';
183 if (strncmp (magic,
"Octave-1-L", magic_len) == 0)
185 else if (strncmp (magic,
"Octave-1-B", magic_len) == 0)
190 error (
"load: unable to read read binary file");
202 error (
"load: unrecognized binary format!");
215 std::ifstream file (fname.c_str ());
218 if (file.read (reinterpret_cast<char *> (magic), 2) && magic[0] == 0x1f &&
241 file.seekg (0, std::ios::beg);
243 int32_t mopt, nr, nc,
imag, len;
253 file.seekg (0, std::ios::beg);
260 file.seekg (0, std::ios::beg);
266 file.seekg (0, std::ios::beg);
275 file.seekg (0, std::ios::beg);
295 bool &use_zlib,
bool quiet =
false)
301 if (H5Fis_hdf5 (fname.c_str ()) > 0)
313 std::ifstream file (fname.c_str ());
340 do_load (std::istream& stream,
const std::string& orig_fname,
342 bool list_only,
bool swap,
bool verbose,
343 const string_vector& argv,
int argv_idx,
int argc,
int nargout)
349 std::ostringstream output_buf;
350 std::list<std::string> symbol_names;
384 argv, argv_idx, argc);
406 warning (
"load: loaded ASCII file '%s' -- ignoring extra args",
407 orig_fname.c_str ());
420 <<
"type rows cols name\n"
421 <<
"==== ==== ==== ====\n";
425 << std::setw (16) << tc.
type_name () . c_str ()
426 << std::setiosflags (std::ios::right)
427 << std::setw (7) << tc.
rows ()
428 << std::setw (7) << tc.
columns ()
429 <<
" " << name <<
"\n";
432 symbol_names.push_back (name);
441 retstruct.
assign (name, tc);
454 error (
"load: unable to load variable '%s'", name.c_str ());
459 error (
"load: are you sure '%s' is an Octave data file?",
460 orig_fname.c_str ());
466 if (list_only && count)
470 std::string msg = output_buf.str ();
491 else if (retstruct.
nfields () != 0)
500 std::string fname = name;
515 "load: file found in load path");
521 size_t dot_pos = fname.rfind (
".");
524 if (dot_pos == std::string::npos
525 || (sep_pos != std::string::npos && dot_pos < sep_pos))
543 error (
"load: unable to find file %s", orig_name.c_str ());
553 bool use_zlib =
false;
557 DEFUN (load, args, nargout,
559 @deftypefn {Command} {} load file\n\
560 @deftypefnx {Command} {} load options file\n\
561 @deftypefnx {Command} {} load options file v1 v2 @dots{}\n\
562 @deftypefnx {Command} {S =} load (\"options\", \"file\", \"v1\", \"v2\", @dots{})\n\
563 @deftypefnx {Command} {} load file options\n\
564 @deftypefnx {Command} {} load file options v1 v2 @dots{}\n\
565 @deftypefnx {Command} {S =} load (\"file\", \"options\", \"v1\", \"v2\", @dots{})\n\
566 Load the named variables @var{v1}, @var{v2}, @dots{}, from the file\n\
567 @var{file}. If no variables are specified then all variables found in the\n\
568 file will be loaded. As with @code{save}, the list of variables to extract\n\
569 can be full names or use a pattern syntax. The format of the file is\n\
570 automatically detected but may be overridden by supplying the appropriate\n\
573 If load is invoked using the functional form\n\
576 load (\"-option1\", @dots{}, \"file\", \"v1\", @dots{})\n\
580 then the @var{options}, @var{file}, and variable name arguments\n\
581 (@var{v1}, @dots{}) must be specified as character strings.\n\
583 If a variable that is not marked as global is loaded from a file when a\n\
584 global symbol with the same name already exists, it is loaded in the\n\
585 global symbol table. Also, if a variable is marked as global in a file\n\
586 and a local symbol exists, the local symbol is moved to the global\n\
587 symbol table and given the value from the file.\n\
589 If invoked with a single output argument, Octave returns data instead\n\
590 of inserting variables in the symbol table. If the data file contains\n\
591 only numbers (TAB- or space-delimited columns), a matrix of values is\n\
592 returned. Otherwise, @code{load} returns a structure with members\n\
593 corresponding to the names of the variables in the file.\n\
595 The @code{load} command can read data stored in Octave's text and\n\
596 binary formats, and @sc{matlab}'s binary format. If compiled with zlib\n\
597 support, it can also load gzip-compressed files. It will automatically\n\
598 detect the type of file and do conversion from different floating point\n\
599 formats (currently only IEEE big and little endian, though other formats\n\
600 may be added in the future).\n\
602 Valid options for @code{load} are listed in the following table.\n\
606 This option is accepted for backward compatibility but is ignored.\n\
607 Octave now overwrites variables currently in memory with\n\
608 those of the same name found in the file.\n\
611 Force Octave to assume the file contains columns of numbers in text format\n\
612 without any header or other information. Data in the file will be loaded\n\
613 as a single numeric matrix with the name of the variable derived from the\n\
617 Force Octave to assume the file is in Octave's binary format.\n\
620 Force Octave to assume the file is in @sc{hdf5} format.\n\
621 (@sc{hdf5} is a free, portable binary format developed by the National\n\
622 Center for Supercomputing Applications at the University of Illinois.)\n\
623 Note that Octave can read @sc{hdf5} files not created by itself, but may\n\
624 skip some datasets in formats that it cannot support. This format is\n\
625 only available if Octave was built with a link to the @sc{hdf5} libraries.\n\
628 This option is accepted for backward compatibility but is ignored.\n\
629 Octave can now support multi-dimensional HDF data and automatically\n\
630 modifies variable names if they are invalid Octave identifiers.\n\
633 @itemx -mat-binary\n\
638 Force Octave to assume the file is in @sc{matlab}'s version 6 or 7 binary\n\
641 @item -mat4-binary\n\
645 Force Octave to assume the file is in the binary format written by\n\
646 @sc{matlab} version 4.\n\
649 Force Octave to assume the file is in Octave's text format.\n\
651 @seealso{save, dlmwrite, csvwrite, fwrite}\n\
656 int argc = args.
length () + 1;
664 std::string orig_fname =
"";
667 if (argc > 1 && ! argv[1].empty () && argv[1].at (0) !=
'-')
669 orig_fname = argv[1];
679 bool list_only =
false;
680 bool verbose =
false;
683 for (; i < argc; i++)
685 if (argv[i] ==
"-force" || argv[i] ==
"-f")
690 else if (argv[i] ==
"-list" || argv[i] ==
"-l")
694 else if (argv[i] ==
"-verbose" || argv[i] ==
"-v")
698 else if (argv[i] ==
"-ascii" || argv[i] ==
"-a")
702 else if (argv[i] ==
"-binary" || argv[i] ==
"-b")
706 else if (argv[i] ==
"-mat-binary" || argv[i] ==
"-mat" || argv[i] ==
"-m"
707 || argv[i] ==
"-6" || argv[i] ==
"-v6")
711 else if (argv[i] ==
"-7" || argv[i] ==
"-v7")
715 else if (argv[i] ==
"-mat4-binary" || argv[i] ==
"-V4"
716 || argv[i] ==
"-v4" || argv[i] ==
"-4")
720 else if (argv[i] ==
"-hdf5" || argv[i] ==
"-h")
725 error (
"load: octave executable was not linked with HDF5 library");
729 else if (argv[i] ==
"-import" || argv[i] ==
"-i")
731 warning (
"load: -import ignored");
733 else if (argv[i] ==
"-text" || argv[i] ==
"-t")
741 if (orig_fname ==
"")
749 orig_fname = argv[i];
758 if (orig_fname ==
"-")
764 error (
"load: cannot read HDF5 format from stdin");
774 retval =
do_load (std::cin, orig_fname, format, flt_fmt,
775 list_only, swap, verbose, argv, i, argc,
779 error (
"load: must specify file format if reading from stdin");
790 bool use_zlib =
false;
802 if (hdf5_file.file_id >= 0)
804 retval =
do_load (hdf5_file, orig_fname, format,
805 flt_fmt, list_only, swap, verbose,
806 argv, i, argc, nargout);
823 std::ios::openmode mode = std::ios::in | std::ios::binary;
836 if (file) file.
close ();
846 if (file) file.close ();
851 retval =
do_load (file, orig_fname, format,
852 flt_fmt, list_only, swap, verbose,
853 argv, i, argc, nargout);
863 std::ifstream file (fname.c_str (), mode);
871 if (file) file.close ();
881 if (file) file.close ();
886 retval =
do_load (file, orig_fname, format,
887 flt_fmt, list_only, swap, verbose,
888 argv, i, argc, nargout);
893 error (
"load: unable to open input file '%s'",
894 orig_fname.c_str ());
909 int len = pattern.length ();
911 for (
int i = 0; i < len; i++)
944 const std::string& name,
const std::string& help,
960 warning (
"save: unable to save %s in ASCII format", name.c_str ());
997 std::string name = sr.
name ();
1001 do_save (os, val, name, help, global, fmt, save_as_floats);
1010 const std::string& pattern,
1019 std::string empty_str;
1024 0, fmt, save_as_floats);
1044 typedef std::list<symbol_table::symbol_record>::const_iterator
1045 const_vars_iterator;
1047 for (const_vars_iterator p = vars.begin (); p != vars.end (); p++)
1049 do_save (os, *p, fmt, save_as_floats);
1063 bool &save_as_floats,
bool &use_zlib)
1066 int argc = argv.
length ();
1068 bool do_double =
false, do_tabs =
false;
1070 for (
int i = 0; i < argc; i++)
1072 if (argv[i] ==
"-append")
1076 else if (argv[i] ==
"-ascii" || argv[i] ==
"-a")
1080 else if (argv[i] ==
"-double")
1084 else if (argv[i] ==
"-tabs")
1088 else if (argv[i] ==
"-text" || argv[i] ==
"-t")
1092 else if (argv[i] ==
"-binary" || argv[i] ==
"-b")
1096 else if (argv[i] ==
"-hdf5" || argv[i] ==
"-h")
1101 error (
"save: octave executable was not linked with HDF5 library");
1104 else if (argv[i] ==
"-mat-binary" || argv[i] ==
"-mat"
1105 || argv[i] ==
"-m" || argv[i] ==
"-6" || argv[i] ==
"-v6"
1106 || argv[i] ==
"-V6")
1111 else if (argv[i] ==
"-mat7-binary" || argv[i] ==
"-7"
1112 || argv[i] ==
"-v7" || argv[i] ==
"-V7")
1117 else if (argv[i] ==
"-mat4-binary" || argv[i] ==
"-V4"
1118 || argv[i] ==
"-v4" || argv[i] ==
"-4")
1122 else if (argv[i] ==
"-float-binary" || argv[i] ==
"-f")
1125 save_as_floats =
true;
1127 else if (argv[i] ==
"-float-hdf5")
1131 save_as_floats =
true;
1133 error (
"save: octave executable was not linked with HDF5 library");
1137 else if (argv[i] ==
"-zip" || argv[i] ==
"-z")
1142 else if (argv[i] ==
"-struct")
1146 else if (argv[i][0] ==
'-')
1148 error (
"save: Unrecognized option '%s'", argv[i].c_str ());
1159 warning (
"save: \"-double\" option only has an effect with \"-ascii\"");
1167 warning (
"save: \"-tabs\" option only has an effect with \"-ascii\"");
1175 bool &append,
bool &save_as_floats,
1178 std::istringstream is (arg);
1195 switch (format.
type)
1200 ?
"Octave-1-B" :
"Octave-1-L");
1214 char const * versionmagic;
1215 int16_t number = *(
reinterpret_cast<const int16_t *
>(
"\x00\x01"));
1218 char headertext[128];
1221 bdt = *gmtime (&now);
1222 memset (headertext,
' ', 124);
1224 nstrftime (headertext, 124,
"MATLAB 5.0 MAT-file, written by Octave "
1235 versionmagic =
"\x01\x00\x4d\x49";
1237 versionmagic =
"\x00\x01\x49\x4d";
1239 memcpy (headertext+124, versionmagic, 4);
1240 os.write (headertext, 128);
1254 if (! comment_string.empty ())
1260 H5Gset_comment (hs.
file_id,
"/", comment_string.c_str ());
1264 os << comment_string <<
"\n";
1293 bool save_as_floats,
bool write_header_info)
1295 if (write_header_info)
1298 if (argv_idx == argc)
1300 save_vars (os,
"*", fmt, save_as_floats);
1302 else if (argv[argv_idx] ==
"-struct")
1304 if (++argv_idx >= argc)
1306 error (
"save: missing struct name");
1310 std::string struct_name = argv[argv_idx];
1314 error (
"save: no such variable: '%s'", struct_name.c_str ());
1320 if (! struct_var.
is_map () || struct_var.
numel () != 1)
1322 error (
"save: '%s' is not a scalar structure",
1323 struct_name.c_str ());
1330 if (argv_idx < argc)
1332 for (
int i = argv_idx; i < argc; i++)
1334 if (!
save_fields (os, struct_var_map, argv[i], fmt,
1337 warning (
"save: no such field '%s.%s'",
1338 struct_name.c_str (), argv[i].c_str ());
1343 save_fields (os, struct_var_map,
"*", fmt, save_as_floats);
1347 for (
int i = argv_idx; i < argc; i++)
1351 if (!
save_vars (os, argv[i], fmt, save_as_floats))
1352 warning (
"save: no such variable '%s'", argv[i].c_str ());
1359 bool save_as_floats)
1363 std::list<symbol_table::symbol_record>
vars
1366 double save_mem_size = 0;
1368 typedef std::list<symbol_table::symbol_record>::const_iterator
1369 const_vars_iterator;
1371 for (const_vars_iterator p = vars.begin (); p != vars.end (); p++)
1377 std::string name = p->name ();
1379 bool global = p->is_global ();
1381 double val_size = val.
byte_size () / 1024;
1385 if (Voctave_core_file_limit < 0
1386 || save_mem_size + val_size < Voctave_core_file_limit)
1388 save_mem_size += val_size;
1390 do_save (os, val, name, help, global, fmt, save_as_floats);
1398 message (0,
"save to '%s' complete", fname);
1410 message (0,
"attempting to save variables to '%s'...", fname);
1414 bool save_as_floats =
false;
1416 bool append =
false;
1418 bool use_zlib =
false;
1421 save_as_floats, use_zlib);
1423 std::ios::openmode mode = std::ios::out;
1436 mode |= std::ios::binary;
1438 mode |= append ? std::ios::ate : std::ios::trunc;
1452 warning (
"unable to open '%s' for writing...", fname);
1471 warning (
"unable to open '%s' for writing...", fname);
1476 std::ofstream file (fname, mode);
1485 warning (
"unable to open '%s' for writing...", fname);
1491 DEFUN (save, args, ,
1493 @deftypefn {Command} {} save file\n\
1494 @deftypefnx {Command} {} save options file\n\
1495 @deftypefnx {Command} {} save options file @var{v1} @var{v2} @dots{}\n\
1496 @deftypefnx {Command} {} save options file -struct @var{STRUCT} @var{f1} @var{f2} @dots{}\n\
1497 Save the named variables @var{v1}, @var{v2}, @dots{}, in the file\n\
1498 @var{file}. The special filename @samp{-} may be used to write\n\
1499 output to the terminal. If no variable names are listed, Octave saves\n\
1500 all the variables in the current scope. Otherwise, full variable names or\n\
1501 pattern syntax can be used to specify the variables to save.\n\
1502 If the @option{-struct} modifier is used, fields @var{f1} @var{f2} @dots{}\n\
1503 of the scalar structure @var{STRUCT} are saved as if they were variables\n\
1504 with corresponding names.\n\
1505 Valid options for the @code{save} command are listed in the following table.\n\
1506 Options that modify the output format override the format specified by\n\
1507 @code{save_default_options}.\n\
1509 If save is invoked using the functional form\n\
1512 save (\"-option1\", @dots{}, \"file\", \"v1\", @dots{})\n\
1516 then the @var{options}, @var{file}, and variable name arguments\n\
1517 (@var{v1}, @dots{}) must be specified as character strings.\n\
1521 Append to the destination instead of overwriting.\n\
1524 Save a single matrix in a text file without header or any other information.\n\
1527 Save the data in Octave's binary data format.\n\
1529 @item -float-binary\n\
1530 Save the data in Octave's binary data format but only using single\n\
1531 precision. Only use this format if you know that all the\n\
1532 values to be saved can be represented in single precision.\n\
1535 Save the data in @sc{hdf5} format.\n\
1536 (HDF5 is a free, portable binary format developed by the National\n\
1537 Center for Supercomputing Applications at the University of Illinois.)\n\
1538 This format is only available if Octave was built with a link to the\n\
1539 @sc{hdf5} libraries.\n\
1541 @item -float-hdf5\n\
1542 Save the data in @sc{hdf5} format but only using single precision.\n\
1543 Only use this format if you know that all the\n\
1544 values to be saved can be represented in single precision.\n\
1549 @itemx -mat7-binary\n\
1550 Save the data in @sc{matlab}'s v7 binary data format.\n\
1556 @itemx -mat-binary\n\
1557 Save the data in @sc{matlab}'s v6 binary data format.\n\
1562 @itemx -mat4-binary\n\
1563 Save the data in the binary format written by @sc{matlab} version 4.\n\
1566 Save the data in Octave's text data format. (default).\n\
1570 Use the gzip algorithm to compress the file. This works equally on files\n\
1571 that are compressed with gzip outside of octave, and gzip can equally be\n\
1572 used to convert the files for backward compatibility.\n\
1573 This option is only available if Octave was built with a link to the zlib\n\
1577 The list of variables to save may use wildcard patterns containing\n\
1578 the following special characters:\n\
1582 Match any single character.\n\
1585 Match zero or more characters.\n\
1587 @item [ @var{list} ]\n\
1588 Match the list of characters specified by @var{list}. If the first\n\
1589 character is @code{!} or @code{^}, match all characters except those\n\
1590 specified by @var{list}. For example, the pattern @code{[a-zA-Z]} will\n\
1591 match all lower and uppercase alphabetic characters.\n\
1593 Wildcards may also be used in the field name specifications when using\n\
1594 the @option{-struct} modifier (but not in the struct name itself).\n\
1598 Except when using the @sc{matlab} binary data file format or the\n\
1599 @samp{-ascii} format, saving global\n\
1600 variables also saves the global status of the variable. If the variable\n\
1601 is restored at a later time using @samp{load}, it will be restored as a\n\
1607 save -binary data a b*\n\
1611 saves the variable @samp{a} and all variables beginning with @samp{b} to\n\
1612 the file @file{data} in Octave's binary format.\n\
1613 @seealso{load, save_default_options, save_header_format_string, dlmread, csvread, fread}\n\
1618 int argc = args.
length ();
1628 bool save_as_floats =
false;
1632 bool append =
false;
1634 bool use_zlib =
false;
1655 if (save_as_floats && format ==
LS_ASCII)
1657 error (
"save: cannot specify both -ascii and -float-binary");
1667 error (
"save: cannot write HDF5 format to stdout");
1674 warning (
"save: ignoring -append option for output to stdout");
1680 save_as_floats,
true);
1701 std::ios::openmode mode
1702 = append ? (std::ios::app | std::ios::ate) : std::ios::out;
1711 mode |= std::ios::binary;
1719 error (
"save: appending to HDF5 files is not implemented");
1723 bool write_header_info = ! (append &&
1724 H5Fis_hdf5 (fname.c_str ()) > 0);
1728 if (hdf5_file.file_id != -1)
1730 save_vars (argv, i, argc, hdf5_file, format,
1731 save_as_floats, write_header_info);
1753 bool write_header_info = ! file.tellp ();
1756 save_as_floats, write_header_info);
1769 std::ofstream file (fname.c_str (), mode);
1773 bool write_header_info = ! file.tellp ();
1776 save_as_floats, write_header_info);
1792 DEFUN (crash_dumps_octave_core, args, nargout,
1794 @deftypefn {Built-in Function} {@var{val} =} crash_dumps_octave_core ()\n\
1795 @deftypefnx {Built-in Function} {@var{old_val} =} crash_dumps_octave_core (@var{new_val})\n\
1796 @deftypefnx {Built-in Function} {} crash_dumps_octave_core (@var{new_val}, \"local\")\n\
1797 Query or set the internal variable that controls whether Octave tries\n\
1798 to save all current variables to the file @file{octave-workspace} if it\n\
1799 crashes or receives a hangup, terminate or similar signal.\n\
1801 When called from inside a function with the @qcode{\"local\"} option, the\n\
1802 variable is changed locally for the function and any subroutines it calls. \n\
1803 The original variable value is restored when exiting the function.\n\
1804 @seealso{octave_core_file_limit, octave_core_file_name, octave_core_file_options}\n\
1810 DEFUN (save_default_options, args, nargout,
1812 @deftypefn {Built-in Function} {@var{val} =} save_default_options ()\n\
1813 @deftypefnx {Built-in Function} {@var{old_val} =} save_default_options (@var{new_val})\n\
1814 @deftypefnx {Built-in Function} {} save_default_options (@var{new_val}, \"local\")\n\
1815 Query or set the internal variable that specifies the default options\n\
1816 for the @code{save} command, and defines the default format.\n\
1817 Typical values include @qcode{\"-ascii\"}, @qcode{\"-text -zip\"}.\n\
1818 The default value is @option{-text}.\n\
1820 When called from inside a function with the @qcode{\"local\"} option, the\n\
1821 variable is changed locally for the function and any subroutines it calls. \n\
1822 The original variable value is restored when exiting the function.\n\
1829 DEFUN (octave_core_file_limit, args, nargout,
1831 @deftypefn {Built-in Function} {@var{val} =} octave_core_file_limit ()\n\
1832 @deftypefnx {Built-in Function} {@var{old_val} =} octave_core_file_limit (@var{new_val})\n\
1833 @deftypefnx {Built-in Function} {} octave_core_file_limit (@var{new_val}, \"local\")\n\
1834 Query or set the internal variable that specifies the maximum amount\n\
1835 of memory (in kilobytes) of the top-level workspace that Octave will\n\
1836 attempt to save when writing data to the crash dump file (the name of\n\
1837 the file is specified by @var{octave_core_file_name}). If\n\
1838 @var{octave_core_file_options} flags specify a binary format,\n\
1839 then @var{octave_core_file_limit} will be approximately the maximum\n\
1840 size of the file. If a text file format is used, then the file could\n\
1841 be much larger than the limit. The default value is -1 (unlimited)\n\
1843 When called from inside a function with the @qcode{\"local\"} option, the\n\
1844 variable is changed locally for the function and any subroutines it calls. \n\
1845 The original variable value is restored when exiting the function.\n\
1846 @seealso{crash_dumps_octave_core, octave_core_file_name, octave_core_file_options}\n\
1852 DEFUN (octave_core_file_name, args, nargout,
1854 @deftypefn {Built-in Function} {@var{val} =} octave_core_file_name ()\n\
1855 @deftypefnx {Built-in Function} {@var{old_val} =} octave_core_file_name (@var{new_val})\n\
1856 @deftypefnx {Built-in Function} {} octave_core_file_name (@var{new_val}, \"local\")\n\
1857 Query or set the internal variable that specifies the name of the file\n\
1858 used for saving data from the top-level workspace if Octave aborts.\n\
1859 The default value is @qcode{\"octave-workspace\"}\n\
1861 When called from inside a function with the @qcode{\"local\"} option, the\n\
1862 variable is changed locally for the function and any subroutines it calls. \n\
1863 The original variable value is restored when exiting the function.\n\
1864 @seealso{crash_dumps_octave_core, octave_core_file_name, octave_core_file_options}\n\
1870 DEFUN (octave_core_file_options, args, nargout,
1872 @deftypefn {Built-in Function} {@var{val} =} octave_core_file_options ()\n\
1873 @deftypefnx {Built-in Function} {@var{old_val} =} octave_core_file_options (@var{new_val})\n\
1874 @deftypefnx {Built-in Function} {} octave_core_file_options (@var{new_val}, \"local\")\n\
1875 Query or set the internal variable that specifies the options used for\n\
1876 saving the workspace data if Octave aborts. The value of\n\
1877 @code{octave_core_file_options} should follow the same format as the\n\
1878 options for the @code{save} function. The default value is Octave's binary\n\
1881 When called from inside a function with the @qcode{\"local\"} option, the\n\
1882 variable is changed locally for the function and any subroutines it calls. \n\
1883 The original variable value is restored when exiting the function.\n\
1884 @seealso{crash_dumps_octave_core, octave_core_file_name, octave_core_file_limit}\n\
1890 DEFUN (save_header_format_string, args, nargout,
1892 @deftypefn {Built-in Function} {@var{val} =} save_header_format_string ()\n\
1893 @deftypefnx {Built-in Function} {@var{old_val} =} save_header_format_string (@var{new_val})\n\
1894 @deftypefnx {Built-in Function} {} save_header_format_string (@var{new_val}, \"local\")\n\
1895 Query or set the internal variable that specifies the format\n\
1896 string used for the comment line written at the beginning of\n\
1897 text-format data files saved by Octave. The format string is\n\
1898 passed to @code{strftime} and should begin with the character\n\
1899 @samp{#} and contain no newline characters. If the value of\n\
1900 @code{save_header_format_string} is the empty string,\n\
1901 the header comment is omitted from text-format data files. The\n\
1903 @c Set example in small font to prevent overfull line\n\
1906 \"# Created by Octave VERSION, %a %b %d %H:%M:%S %Y %Z <USER@@HOST>\"\n\
1907 @end smallexample\n\
1909 When called from inside a function with the @qcode{\"local\"} option, the\n\
1910 variable is changed locally for the function and any subroutines it calls. \n\
1911 The original variable value is restored when exiting the function.\n\
1912 @seealso{strftime, save}\n\