collinm wrote:
>
> in a c program, i copy often file on nfs
> to see if i can see the nfs i do something like:
>
> if((exist = stat(mnt_dir, &buf))==0){
>
> if((fp = fopen(tmp_mnt_dir_www, "w"))!=NULL)
> {
> }
> else
> printf("problem\n");
> }
>
> my problem is: if nfs is not available, my program seem to block,
> freeze a couple of second... is there a way to avoid that?
This is comp.lang.c, where we discuss only the standard C language,
as defined in the C90, C99 (and older K&R) standards. This means
you must either publish the source of routines you call, or call
routines defined in the standard. stat fits into neither
category. Thus if you do get a reply it is likely to be wrong,
certainly will not be reviewed by knowledgeable people, and the
whole mess is off-topic here.
You may want to try a newsgroup that handles Posix or Unix.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
|