How can I determine if a file is read-only for my process on *nix?
- by user109078
Using the stat function, I can get the read/write permissions for:
owner
user
other
...but this isn't what I want. I want to know the read/write permissions of a file for my process (i.e. the application I'm writing). The owner/user/other is only helpful if I know if my process is running as the owner/user/other of the file...so maybe that's the solution but I'm not sure of the steps to get there.