I am trying to write a json file into the data storage system from Databricks by using
open('/dbfs/mypath/test.json', 'wb').write(files)
I am getting the following error:
FileNotFoundError: [Errno 2] No such file or directory: '/dbfs/mypath/test.json'
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File <command-4437961952528903>:5
----> 1 open('/dbfs/mypath/test.json', 'wb').write(files)
I do not know what I am doing wrong, does any body knows if I can use this way to safe the binary file? Thanks in advance
I use the different commands
dbutils.fs.put('/myPath/test.json',files)
but this is for creating a text file as far as I know, I am not sure how to do it.