Which of these is the best practice:
- Set umask and create files with appropriate file permissions OR
- Create files and then use chmod() to set appropriate file permissions
if we use umask in a thread, does it affect files created in other threads?
I know chmod affects only the file, but is likely to fail, if the files are created by a different user.