1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
5
<title>GNU Octave: Saving Data on Unexpected Exits</title>
7
<meta name="description" content="GNU Octave: Saving Data on Unexpected Exits">
8
<meta name="keywords" content="GNU Octave: Saving Data on Unexpected Exits">
9
<meta name="resource-type" content="document">
10
<meta name="distribution" content="global">
11
<meta name="Generator" content="makeinfo">
12
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
13
<link href="index.html#Top" rel="start" title="Top">
14
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
15
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
16
<link href="Simple-File-I_002fO.html#Simple-File-I_002fO" rel="up" title="Simple File I/O">
17
<link href="C_002dStyle-I_002fO-Functions.html#C_002dStyle-I_002fO-Functions" rel="next" title="C-Style I/O Functions">
18
<link href="Simple-File-I_002fO.html#Simple-File-I_002fO" rel="prev" title="Simple File I/O">
19
<style type="text/css">
21
a.summary-letter {text-decoration: none}
22
blockquote.smallquotation {font-size: smaller}
23
div.display {margin-left: 3.2em}
24
div.example {margin-left: 3.2em}
25
div.indentedblock {margin-left: 3.2em}
26
div.lisp {margin-left: 3.2em}
27
div.smalldisplay {margin-left: 3.2em}
28
div.smallexample {margin-left: 3.2em}
29
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
30
div.smalllisp {margin-left: 3.2em}
31
kbd {font-style:oblique}
32
pre.display {font-family: inherit}
33
pre.format {font-family: inherit}
34
pre.menu-comment {font-family: serif}
35
pre.menu-preformatted {font-family: serif}
36
pre.smalldisplay {font-family: inherit; font-size: smaller}
37
pre.smallexample {font-size: smaller}
38
pre.smallformat {font-family: inherit; font-size: smaller}
39
pre.smalllisp {font-size: smaller}
40
span.nocodebreak {white-space:nowrap}
41
span.nolinebreak {white-space:nowrap}
42
span.roman {font-family:serif; font-weight:normal}
43
span.sansserif {font-family:sans-serif; font-weight:normal}
44
ul.no-bullet {list-style: none}
51
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
52
<a name="Saving-Data-on-Unexpected-Exits"></a>
55
Up: <a href="Simple-File-I_002fO.html#Simple-File-I_002fO" accesskey="u" rel="up">Simple File I/O</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
58
<a name="Saving-Data-on-Unexpected-Exits-1"></a>
59
<h4 class="subsubsection">14.1.3.1 Saving Data on Unexpected Exits</h4>
61
<p>If Octave for some reason exits unexpectedly it will by default save the
62
variables available in the workspace to a file in the current directory.
63
By default this file is named ‘<samp>octave-workspace</samp>’ and can be loaded
64
into memory with the <code>load</code> command. While the default behavior
65
most often is reasonable it can be changed through the following
68
<a name="XREFcrash_005fdumps_005foctave_005fcore"></a><dl>
69
<dt><a name="index-crash_005fdumps_005foctave_005fcore"></a>Built-in Function: <em><var>val</var> =</em> <strong>crash_dumps_octave_core</strong> <em>()</em></dt>
70
<dt><a name="index-crash_005fdumps_005foctave_005fcore-1"></a>Built-in Function: <em><var>old_val</var> =</em> <strong>crash_dumps_octave_core</strong> <em>(<var>new_val</var>)</em></dt>
71
<dt><a name="index-crash_005fdumps_005foctave_005fcore-2"></a>Built-in Function: <em></em> <strong>crash_dumps_octave_core</strong> <em>(<var>new_val</var>, "local")</em></dt>
72
<dd><p>Query or set the internal variable that controls whether Octave tries
73
to save all current variables to the file <samp>octave-workspace</samp> if it
74
crashes or receives a hangup, terminate or similar signal.
76
<p>When called from inside a function with the <code>"local"</code> option, the
77
variable is changed locally for the function and any subroutines it calls.
78
The original variable value is restored when exiting the function.
80
<p><strong>See also:</strong> <a href="#XREFoctave_005fcore_005ffile_005flimit">octave_core_file_limit</a>, <a href="#XREFoctave_005fcore_005ffile_005fname">octave_core_file_name</a>, <a href="#XREFoctave_005fcore_005ffile_005foptions">octave_core_file_options</a>.
84
<a name="XREFsighup_005fdumps_005foctave_005fcore"></a><dl>
85
<dt><a name="index-sighup_005fdumps_005foctave_005fcore"></a>Built-in Function: <em><var>val</var> =</em> <strong>sighup_dumps_octave_core</strong> <em>()</em></dt>
86
<dt><a name="index-sighup_005fdumps_005foctave_005fcore-1"></a>Built-in Function: <em><var>old_val</var> =</em> <strong>sighup_dumps_octave_core</strong> <em>(<var>new_val</var>)</em></dt>
87
<dt><a name="index-sighup_005fdumps_005foctave_005fcore-2"></a>Built-in Function: <em></em> <strong>sighup_dumps_octave_core</strong> <em>(<var>new_val</var>, "local")</em></dt>
88
<dd><p>Query or set the internal variable that controls whether Octave tries
89
to save all current variables to the file <samp>octave-workspace</samp> if it
90
receives a hangup signal.
92
<p>When called from inside a function with the <code>"local"</code> option, the
93
variable is changed locally for the function and any subroutines it calls.
94
The original variable value is restored when exiting the function.
98
<a name="XREFsigterm_005fdumps_005foctave_005fcore"></a><dl>
99
<dt><a name="index-sigterm_005fdumps_005foctave_005fcore"></a>Built-in Function: <em><var>val</var> =</em> <strong>sigterm_dumps_octave_core</strong> <em>()</em></dt>
100
<dt><a name="index-sigterm_005fdumps_005foctave_005fcore-1"></a>Built-in Function: <em><var>old_val</var> =</em> <strong>sigterm_dumps_octave_core</strong> <em>(<var>new_val</var>)</em></dt>
101
<dt><a name="index-sigterm_005fdumps_005foctave_005fcore-2"></a>Built-in Function: <em></em> <strong>sigterm_dumps_octave_core</strong> <em>(<var>new_val</var>, "local")</em></dt>
102
<dd><p>Query or set the internal variable that controls whether Octave tries
103
to save all current variables to the file <samp>octave-workspace</samp> if it
104
receives a terminate signal.
106
<p>When called from inside a function with the <code>"local"</code> option, the
107
variable is changed locally for the function and any subroutines it calls.
108
The original variable value is restored when exiting the function.
112
<a name="XREFoctave_005fcore_005ffile_005foptions"></a><dl>
113
<dt><a name="index-octave_005fcore_005ffile_005foptions"></a>Built-in Function: <em><var>val</var> =</em> <strong>octave_core_file_options</strong> <em>()</em></dt>
114
<dt><a name="index-octave_005fcore_005ffile_005foptions-1"></a>Built-in Function: <em><var>old_val</var> =</em> <strong>octave_core_file_options</strong> <em>(<var>new_val</var>)</em></dt>
115
<dt><a name="index-octave_005fcore_005ffile_005foptions-2"></a>Built-in Function: <em></em> <strong>octave_core_file_options</strong> <em>(<var>new_val</var>, "local")</em></dt>
116
<dd><p>Query or set the internal variable that specifies the options used for
117
saving the workspace data if Octave aborts. The value of
118
<code>octave_core_file_options</code> should follow the same format as the
119
options for the <code>save</code> function. The default value is Octave’s binary
122
<p>When called from inside a function with the <code>"local"</code> option, the
123
variable is changed locally for the function and any subroutines it calls.
124
The original variable value is restored when exiting the function.
126
<p><strong>See also:</strong> <a href="#XREFcrash_005fdumps_005foctave_005fcore">crash_dumps_octave_core</a>, <a href="#XREFoctave_005fcore_005ffile_005fname">octave_core_file_name</a>, <a href="#XREFoctave_005fcore_005ffile_005flimit">octave_core_file_limit</a>.
130
<a name="XREFoctave_005fcore_005ffile_005flimit"></a><dl>
131
<dt><a name="index-octave_005fcore_005ffile_005flimit"></a>Built-in Function: <em><var>val</var> =</em> <strong>octave_core_file_limit</strong> <em>()</em></dt>
132
<dt><a name="index-octave_005fcore_005ffile_005flimit-1"></a>Built-in Function: <em><var>old_val</var> =</em> <strong>octave_core_file_limit</strong> <em>(<var>new_val</var>)</em></dt>
133
<dt><a name="index-octave_005fcore_005ffile_005flimit-2"></a>Built-in Function: <em></em> <strong>octave_core_file_limit</strong> <em>(<var>new_val</var>, "local")</em></dt>
134
<dd><p>Query or set the internal variable that specifies the maximum amount
135
of memory (in kilobytes) of the top-level workspace that Octave will
136
attempt to save when writing data to the crash dump file (the name of
137
the file is specified by <var>octave_core_file_name</var>). If
138
<var>octave_core_file_options</var> flags specify a binary format,
139
then <var>octave_core_file_limit</var> will be approximately the maximum
140
size of the file. If a text file format is used, then the file could
141
be much larger than the limit. The default value is -1 (unlimited)
143
<p>When called from inside a function with the <code>"local"</code> option, the
144
variable is changed locally for the function and any subroutines it calls.
145
The original variable value is restored when exiting the function.
147
<p><strong>See also:</strong> <a href="#XREFcrash_005fdumps_005foctave_005fcore">crash_dumps_octave_core</a>, <a href="#XREFoctave_005fcore_005ffile_005fname">octave_core_file_name</a>, <a href="#XREFoctave_005fcore_005ffile_005foptions">octave_core_file_options</a>.
151
<a name="XREFoctave_005fcore_005ffile_005fname"></a><dl>
152
<dt><a name="index-octave_005fcore_005ffile_005fname"></a>Built-in Function: <em><var>val</var> =</em> <strong>octave_core_file_name</strong> <em>()</em></dt>
153
<dt><a name="index-octave_005fcore_005ffile_005fname-1"></a>Built-in Function: <em><var>old_val</var> =</em> <strong>octave_core_file_name</strong> <em>(<var>new_val</var>)</em></dt>
154
<dt><a name="index-octave_005fcore_005ffile_005fname-2"></a>Built-in Function: <em></em> <strong>octave_core_file_name</strong> <em>(<var>new_val</var>, "local")</em></dt>
155
<dd><p>Query or set the internal variable that specifies the name of the file
156
used for saving data from the top-level workspace if Octave aborts.
157
The default value is <code>"octave-workspace"</code>
159
<p>When called from inside a function with the <code>"local"</code> option, the
160
variable is changed locally for the function and any subroutines it calls.
161
The original variable value is restored when exiting the function.
163
<p><strong>See also:</strong> <a href="#XREFcrash_005fdumps_005foctave_005fcore">crash_dumps_octave_core</a>, <a href="#XREFoctave_005fcore_005ffile_005fname">octave_core_file_name</a>, <a href="#XREFoctave_005fcore_005ffile_005foptions">octave_core_file_options</a>.
170
Up: <a href="Simple-File-I_002fO.html#Simple-File-I_002fO" accesskey="u" rel="up">Simple File I/O</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>