How can I determine if a file is read-only for my process on *nix?
Posted
by
user109078
on Stack Overflow
See other posts from Stack Overflow
or by user109078
Published on 2012-09-23T21:29:18Z
Indexed on
2012/09/23
21:37 UTC
Read the original article
Hit count: 192
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.
© Stack Overflow or respective owner