file

A

ashu

i want to make a program that accept a file and chechs if it is
readable and writable and give appropriate messeage ?
i can make program to accpet filename from command line and open it in
any omde and write data in it, but to know its permission is seems
tricky, is there apecific function available ?
 
P

Pietro Cerutti

ashu said:
i want to make a program that accept a file and chechs if it is
readable and writable and give appropriate messeage ?
i can make program to accpet filename from command line and open it in
any omde and write data in it, but to know its permission is seems
tricky, is there apecific function available ?

Not in Standard C.
If you're using a POSIX-compliant system, look for stat(2) and fstat(2).
 
S

santosh

i want to make a program that accept a file and chechs if it is
readable and writable and give appropriate messeage ?
i can make program to accpet filename from command line and open it
in any omde and write data in it, but to know its permission is
seems tricky, is there apecific function available ?

Yes, but you need to ask in a group for your system. If it's UNIX or
Linux, I suggest or
If it's for Windows then
might be appropriate. Also
take a look at the man pages on your system, (if it's a UNIX), or
browse Microsoft's MSDN online documentation, for Windows.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top