yoda
September 8, 2023, 6:22pm
1
I find my code is not able to create folders in a fly /data
volume.
I would like to know if this is the default?
In addition to that, if this is not the default:
Is it correct to save my file to /data/folder_that_my_code_creates/data.ext
?
With a code like
with open("/data/folder_that_my_code_creates/data.ext") as f:
f.write('')
Thanks
rubys
September 8, 2023, 7:21pm
2
Try running os.mkdirs
or pathlib.Path().mkdir
first. Both support exist_ok=True
in modern versons of Python. For older versions of python catch OSError and ignore errno.EEXIST.
yoda
September 8, 2023, 7:28pm
3
Thanks, checking that out
yoda
September 9, 2023, 3:37pm
4
I fixed the issue
I was able to see my created folder per region but found out it was of file type using stat filename
I used rm file
to remove it from the diff regions
I implemented my code to create a directory with the os.mkdirs
It worked
As well worth it to note that my mkdirs was buggy as well and checking that the paths were files or folders helped as well
Thanks for the help.
system
Closed
September 16, 2023, 3:38pm
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.