You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to create a folder structure with file-system I noticed that there is something strange going on. While I can see that mkdir's -p option is implicit when creating a folder structure like this for instance: /storage/:userId/a/b/c/d with permissions 0o777. The permissions are only ever applied to directory d while the rest of the folder structure is set at the default (which I believe is 0o755) which is likely to cause issues when trying to save uploads as different files would be saved at different points along the directory path specified above.
The only way I have successfully managed to give all directories in the structure the same permissions so far is by adding each directory one at a time which is less than ideal. Below is an example of the code I have tried:
I have also tried using mkdirSync() and ended up with the same issue, in fact even when doing it one directory at a time mkdirSync() does not seem to set the permissions unless you call chmodSync() straight after.
At this stage I don't know if I am doing something wrong or if this is intended behaviour but its starting to frustrate me.
Could anyone shed any light on this?
Thanks
The text was updated successfully, but these errors were encountered:
While trying to create a folder structure with file-system I noticed that there is something strange going on. While I can see that mkdir's
-p
option is implicit when creating a folder structure like this for instance:/storage/:userId/a/b/c/d
with permissions 0o777. The permissions are only ever applied to directoryd
while the rest of the folder structure is set at the default (which I believe is 0o755) which is likely to cause issues when trying to save uploads as different files would be saved at different points along the directory path specified above.The only way I have successfully managed to give all directories in the structure the same permissions so far is by adding each directory one at a time which is less than ideal. Below is an example of the code I have tried:
I have also tried using
mkdirSync()
and ended up with the same issue, in fact even when doing it one directory at a timemkdirSync()
does not seem to set the permissions unless you callchmodSync()
straight after.At this stage I don't know if I am doing something wrong or if this is intended behaviour but its starting to frustrate me.
Could anyone shed any light on this?
Thanks
The text was updated successfully, but these errors were encountered: