if ((fptr = fopen(filename, "r")) == NULL){
  printf("file error message...\n");
} else {
    dosomething...;
    domore...;
}


You will need to declare the pointer to file and declare filename[] value.   
Sorry, I took up C years ago and have forgotten a lot but this should help 
you check the file. see man fopen


jay


On Fri, 12 Jul 2002, cana rich wrote:

> Hi,
> 
>      I tried to make a daemon which check if a file
> exist in a directory so I made a "fileopen" in "read"
> mode in a loop (while (1)...).
> That's why i have a segmentation fault.
> Is someone have an other method to do it without a
> segmentation fault?
> 
> Thanks for your help.
> 
> Canarich
 

-- 
blahblahblah



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to