File Permissions
How to check in a C Program
wheter the given filename can have the write permission or not... for example suppose if a program has to create a filename ex: ./a.out -output /home/ravi/outfile.txt has to be created then how do we check wheter /home/ravi is a correct directory and it has writable permissions in the program ???? any idea???? |
man access (if you just want permissions info) or info stat (if you want more detailed info) should tell you what you are looking for, if I understood what it was that you want.
hope this helps, jrtayloriv |
Usually you just try to create the file and see if fopen()/open() failed. If it fails because of permissions then errno will be set to EPERM.
|
All times are GMT -5. The time now is 11:55 PM. |