hello everyone
i am having an issue with opening a file. it is meant to open the file in a web browser...
detailed
i am writing a webserver everything works apart from when i try to open a 404.html error file
the permissions are rwx-rwx-rwx and not assigned to root for 404.html
i have no idea why this doesnt work! everything looks fine
Code:
strcpy(resource,webroot);
if(fd1 == -1)
{
printf("404 error fd1 = %d\n", fd1);
memset(ptr,0,1);
strcpy(ptr,"404.html");
strcpy(resource,errors);
strcat(resource,ptr);
fd1 = open(resource,O_RDONLY,0);
printf("Opening \"%s\"%d\n",resource,fd1);
}
all help is much appreciated
instead of printing the 404 error i get an error from firefox saying connection was reset when on terminal the program prints it has sent the 404.html file and the program is still running