0

I am trying to run the following piece of code on 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)

but i get the error [Errno 38] Function not implemented

    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

can anyone help to solve it?

sina majd
  • 53
  • 1
  • 6

1 Answers1

1

/content/drive is a FUSE filesystem which doesn't support this operation.

If you are just trying to create a file, use instead open(log_loss_path, 'w').

Bob Smith
  • 36,107
  • 11
  • 98
  • 91