I want to change permission of file inside python file system (pyfilesystem).
Here's the code I have:
fslocal = fs.osfs.OSFS(localdir, create=True, thread_synchronize=True)
fslocal.setcontents('/file1', b'This is file 1')
Now I want to change file permission of file 1. I am using os.chmod for this
os.chmod(localdir + '/file1', stat.S_IWOTH)
However, I get this error:
Traceback (most recent call last):
File "/Users/user/.conda/envs/scram/lib/python3.4/site-packages/fs/errors.py", line 257, in wrapper
return func(self,*args,**kwds)
File "/Users/user/.conda/envs/scram/lib/python3.4/site-packages/fs/osfs/__init__.py", line 251, in listdir
listing = os.listdir(sys_path)
PermissionError: [Errno 13] Permission denied: '/Users/user/Documents/tests/function/arwan/localfs/file1
Can you please tell me if it is possible to do it and how?
Thanks.