home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / programm / 5207 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  1.4 KB

  1. Path: sparky!uunet!utcsri!white.toronto.edu!jwang
  2. Newsgroups: comp.unix.programmer
  3. From: jwang@white.toronto.edu (Jingwen Wang)
  4. Subject: Ho to avoid hanging when file server is down?
  5. Message-ID: <1992Nov7.160534.609@jarvis.csri.toronto.edu>
  6. Organization: CSRI, University of Toronto
  7. Date: 7 Nov 92 21:05:34 GMT
  8. Lines: 35
  9.  
  10.  
  11.    I am writing a daemon that would occasionally log events into a log file.
  12. The log file is in the file server and I am using fprintf() to write records
  13. into the file. The problem is: if the file server is down, I do not want to
  14. hang there until the file server comes back. I would prefer to continue
  15. to do other things and when file server comes back, I write the information
  16. in batch.
  17.  
  18.    My questions are:
  19.  
  20. 1. Is there a way to know if the file server is down before I actually 
  21.    execute fprintf()?
  22.  
  23. 2. If the file is NFS automounted from another file server, I sometimes
  24.    got a 'Stale NFS file handle' message when the server comes back from
  25.    a reboot. 
  26.  
  27.    For the second question, if I close and re-open the file, then it would
  28.    be fine, but still there is possible hanging during fopen().
  29.  
  30. Any help?
  31.  
  32. Thanks.
  33.  
  34. jwang
  35.  
  36.   {}
  37. {}(){} -----> Jingwen Wang, Univ. of Toronto       (416)-978-1675 (office)
  38.   {}          jwang@sys.toronto.edu         (416)-593-6750 (home)
  39.  
  40. --
  41.   {}
  42. {}(){} -----> Jingwen Wang, Univ. of Toronto       (416)-978-1675 (office)
  43.   {}          jwang@snow.white.toronto.edu         1-800-ASK-wang (home)
  44.  
  45.