【发布时间】:2015-10-27 09:47:28
【问题描述】:
当 Octave 崩溃时,如何禁止 Octave 在工作目录中创建 octave-workspace 文件?
我在octave_core_file_options() 中没有看到任何禁用它的选项。这可能吗?也许通过在终止时自动删除文件来进行黑客攻击? (问题是 .octaverc 在开始时运行)
【问题讨论】:
标签: configuration octave
当 Octave 崩溃时,如何禁止 Octave 在工作目录中创建 octave-workspace 文件?
我在octave_core_file_options() 中没有看到任何禁用它的选项。这可能吗?也许通过在终止时自动删除文件来进行黑客攻击? (问题是 .octaverc 在开始时运行)
【问题讨论】:
标签: configuration octave
你要找的是crash_dumps_octave_core:
查询或设置控制 Octave 在崩溃或收到挂断、终止或类似信号时是否尝试将所有当前变量保存到文件“octave-workspace”的内部变量。
为了完整起见,这一系列函数(octave_core_file_limit、octave_core_file_name 和 octave_core_file_options)在名称上使用“octave_core”而不是“octave_workspace”的原因是,在旧版本中,默认名称为该文件是“octave-workspace”。
你怎么会自己找到这个?
octave_core_file_options。如果您看到该功能帮助文本的底部,您会发现:
另请参阅:crash_dumps_octave_core、octave_core_file_name、octave_core_file_limit。
doc octave_core查看有关此功能的手册部分
您可以使用lookfor 命令搜索函数:
octave> lookfor octave_core
crash_dumps_octave_core Query or set the internal variable that controls whethe
r Octave tries to save all current variables to the file '
'octave-workspace' if it crashes or receives a hangup, ter
rminate or similar signal.
octave_core_file_limit Query or set the internal variable that specifies the ma
ximum amount of memory (in kilobytes) of the top-level wor
rkspace that Octave will attempt to save when writing data
a to the crash dump file (the name of the file is specifie
ed by OCTAVE_CORE_FILE_NAME).
octave_core_file_name Query or set the internal variable that specifies the nam
e of the file used for saving data from the top-level work
kspace if Octave aborts.
octave_core_file_options Query or set the internal variable that specifies the
options used for saving the workspace data if Octave abort
ts.
sighup_dumps_octave_core Query or set the internal variable that controls wheth
er Octave tries to save all current variables to the file
'octave-workspace' if it receives a hangup signal.
sigterm_dumps_octave_core Query or set the internal variable that controls whet
her Octave tries to save all current variables to the file
e 'octave-workspace' if it receives a terminate signal.
【讨论】:
octave-workspace 总是被创建,而不仅仅是在你有错误的时候。我想我从来没有在没有错误的情况下制作过一个脚本,呵呵。文件名非常不直观。再次感谢!
exit() 函数可以实际退出 Octave。也可以使用 Ctrl-D 快捷键(发送 EOF 信号,不确定在非 Linux 下是否有效)