【问题标题】:What's the idiomatic way to create temporary files in mosel?在 mosel 中创建临时文件的惯用方法是什么?
【发布时间】:2019-10-18 00:05:37
【问题描述】:

我正在寻找类似于 R/Python 中的 tempfile 函数的东西: https://docs.python.org/3/library/tempfile.html https://www.rdocumentation.org/packages/base/versions/3.6.1/topics/tempfile

摩泽尔有这种情况吗?

【问题讨论】:

    标签: temporary-files mosel


    【解决方案1】:

    您可以使用 I/O 驱动程序“tmp:”在 Mosel 实例的临时目录中创建一个文件,可能结合函数“newmuid”创建一个唯一标识符作为文件名,例如:

    tmpfname:="tmp:"+newmuid
    fopen(tmpfname, F_OUTPUT)
    writeln("This line is written into the temporary file")
    fclose(F_OUTPUT)
    

    【讨论】:

      猜你喜欢
      • 2015-01-07
      • 2012-09-01
      • 2020-04-28
      • 1970-01-01
      • 2011-05-29
      • 2016-05-01
      • 1970-01-01
      • 2012-11-10
      • 2011-06-01
      相关资源
      最近更新 更多