【问题标题】:octave: disable octave-workspace crash fileoctave:禁用 octave-workspace 崩溃文件
【发布时间】:2015-10-27 09:47:28
【问题描述】:

当 Octave 崩溃时,如何禁止 Octave 在工作目录中创建 octave-workspace 文件?

我在octave_core_file_options() 中没有看到任何禁用它的选项。这可能吗?也许通过在终止时自动删除文件来进行黑客攻击? (问题是 .octaverc 在开始时运行)

相关(但不重复):Hide octave-workspace file from home directory

【问题讨论】:

    标签: configuration octave


    【解决方案1】:

    你要找的是crash_dumps_octave_core:

    查询或设置控制 Octave 在崩溃或收到挂断、终止或类似信号时是否尝试将所有当前变量保存到文件“octave-workspace”的内部变量。

    为了完整起见,这一系列函数(octave_core_file_limitoctave_core_file_nameoctave_core_file_options)在名称上使用“octave_core”而不是“octave_workspace”的原因是,在旧版本中,默认名称为该文件是“octave-workspace”。

    你怎么会自己找到这个?

    1. 根据您的问题,您已经知道octave_core_file_options。如果您看到该功能帮助文本的底部,您会发现:

      另请参阅:crash_dumps_octave_core、octave_core_file_name、octave_core_file_limit。

    2. 通过调用doc octave_core查看有关此功能的手册部分
    3. 您可以使用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 的长期用户,我的印象是 octave-workspace 总是被创建,而不仅仅是在你有错误的时候。我想我从来没有在没有错误的情况下制作过一个脚本,呵呵。文件名非常不直观。再次感谢!
    • @RicardoCruz 不是每次出现错误,而是崩溃时。如果你总是得到一个,你一定做错了什么。你在做什么来退出 Octave?
    • 啊!!我只是在终端窗口仍在运行时关闭它哦...这就是创建核心文件的原因...我感到很尴尬:P
    • @RicardoCruz 有一个 exit() 函数可以实际退出 Octave。也可以使用 Ctrl-D 快捷键(发送 EOF 信号,不确定在非 Linux 下是否有效)
    • 是的,我知道,这只是出于懒惰。 :) 顺便说一句,我稍微改写了这个问题,以反映文件仅在崩溃时创建的事实。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-05
    相关资源
    最近更新 更多