home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4564 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  1.6 KB

  1. Path: sparky!uunet!wupost!gumby!yale!mintaka.lcs.mit.edu!ai-lab!kauai!bkph
  2. From: bkph@kauai.ai.mit.edu (Berthold K.P. Horn)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: avoiding sharing violations
  5. Date: 4 Jan 1993 13:09:13 GMT
  6. Organization: MIT Artificial Intelligence Lab
  7. Lines: 27
  8. Message-ID: <1i9ctpINNbba@life.ai.mit.edu>
  9. NNTP-Posting-Host: kauai.ai.mit.edu
  10.  
  11.  
  12. I have a previewer application that checks every few seconds whether
  13. the file it is displaying has changed.  If it finds it has changed
  14. it goes ahead and repaints the screen.  Some other application creates
  15. (compiles) the file.  
  16.  
  17. The user typically will use an editor in one Windows to edit the source
  18. file, then run an application in another Window that `compiles' it, while
  19. viewing the result in a third Window. I want the viewing part to be
  20. automatically updated when the file is changed, (without explicit 
  21. communication between the `compiler' and the `viewer').
  22.  
  23. Things work OK, if I do NOT have SHARE.EXE installed.  If I do, I start to
  24. get sharing violations.  I've tried several combinations of flags for
  25. OpenFile without any luck.  I thought SHARE was supposed to help
  26. applications that want to get at the same file!  
  27.  
  28. So my question is, how can I determnine whether some other application has a
  29. particular file open so I don't try to open it and get slapped across the
  30. wrist?  What combination of flags in OpenFile gives me some code that
  31. tells me the file is in use (or hangs me up until it it not), WITHOUT
  32. giving me these unpleasant `sharing violations'?
  33.  
  34. Thanks.
  35.  
  36. Berthold K.P. Horn
  37. Cambridge, Massachusetts, USA
  38.