【问题标题】:os.mknod returns [error38] function not implemented in google colabos.mknod 返回 [error38] 函数未在 google colab 中实现
【发布时间】:2019-06-19 05:45:39
【问题描述】:

我正在尝试在 google colab 上运行以下代码。

dir_path = '/content/drive/My Drive/Colab Notebooks'
log_loss_path =os.path.join(dir_path, 'log_loss.txt')
if not os.path.isfile(log_loss_path):
    os.mknod(log_loss_path)

但我收到错误 [Errno 38] 功能未实现

    OSError                                   Traceback (most recent call last)
<ipython-input-15-bd3880e6bb8b> in <module>()
      2 log_loss_path = os.path.join(dir_path, 'log_loss.txt')
      3 if not os.path.isfile(log_loss_path):
----> 4     os.mknod(log_loss_path)

OSError: [Errno 38] Function not implemented

谁能帮忙解决?

【问题讨论】:

    标签: python pytorch google-colaboratory mknod


    【解决方案1】:

    /content/drive 是 FUSE 文件系统,不支持此操作。

    如果您只是想创建一个文件,请改用open(log_loss_path, 'w')

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-25
      • 2020-06-07
      • 1970-01-01
      • 2020-11-02
      • 1970-01-01
      • 2020-06-14
      • 2019-08-20
      • 1970-01-01
      相关资源
      最近更新 更多