In C:
if( (opfd= open(fpath, O_CREAT | O_RDWR, 777))<0)
{perror("open sys call");
exit(1);}
then i write an array to this file (works fine)
then close(opfd);
when i iterate again and try to enter the same file name, it gives me this error “Permission denied” while i set the permissions to 777
Maybe you should try
0777(which is octal — and not the same as777). A leading0in C denotes an octal value.BTW,
777(decimal) is1411(octal), which would seem to explain why you’re having trouble overwriting.