Ok so I am having a problem using the method stat(), I need to find the filesize of a file and return it as a const char *, So i would need to convert the int value to a char. This is what i have now which does compile but it doesnt do anything now.
char pname[128]; // is equal to ./pages/index.html
int r = 0;
char tmp[20];
r = stat(pname, &statbuf);
sprintf (tmp, "%d",r);
write(1,tmp,strlen(tmp));