I have created a txt file (named "output.txt") using c socket program. Its been created but i dont have the permission to open that txt file. while 2 days back when i executed my program i could open the output.txt file. why cant i open it now?
Permission for my output.txt file is
-r----x--t 1 root root 12288 Oct 19 10:24 output.txt
Code for creating it:
new_sockfd = accept(sockfd,(struct sockaddr *)&client_address, &client_len);
if (new_sockfd==-1) { perror("Connection Not Accepted!!"); return(1);}
else
{
printf("client is connected\n");
log=open("output.txt",O_CREAT|O_RDWR|O_APPEND,777);
do
{
x1=read(new_sockfd, buffer1, 1024);
x2=write(log,buffer1,x1);
}
while (x1>0);
close(log);
}
close(new_sockfd);