home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / database / informix / 1714 < prev    next >
Encoding:
Internet Message Format  |  1992-08-13  |  3.7 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!sol.ctr.columbia.edu!emory!bnr.co.uk
  2. From: A.Heskett@bnr.co.uk (Tony Heskett)
  3. Newsgroups: comp.databases.informix
  4. Subject: Re: Interrupt Message
  5. Message-ID: <9303@emory.mathcs.emory.edu>
  6. Date: 13 Aug 92 12:18:03 GMT
  7. Sender: walt@mathcs.emory.edu
  8. Reply-To: A.Heskett@bnr.co.uk (Tony Heskett)
  9. Lines: 81
  10. X-Informix-List-ID: <list.1375>
  11.  
  12.  
  13. Since no-one else seems to have bitten yet ...
  14.  
  15. Richard Ridley writes:
  16.  
  17. > A background process will be started up by a particular user when running
  18. > an application - this background process will monitor a direcory and,
  19. > whenever a new file is copied into the directory, will inform the user
  20. > (either using a tty or the login name) that a new file has been placed
  21. > into the directory.
  22.  
  23. If you use a windowing system, or allow a number of users to use
  24. the same login, you gotta be quite careful that you get the *right* tty.
  25.  
  26. > [ ... write(1) is messy ... ]
  27.  
  28. > What we would like to be able to do is to interrupt whatever the user is doing
  29. > place the message in the middle of the screen (possibly in a box or after
  30. > clearing the screen), wait for a key to be pressed after the message has
  31. > been read, redraw the screen and let the user continue whatever he/she
  32. > was doing.
  33.  
  34. If you do that, you have a number of problems:
  35.  
  36. *   The original app is likely to be reading from the tty.
  37.     Your 'Got-a-new-file' display will also be reading from the
  38.     tty, to get the ACK from the user.   It's a toss-up who gets
  39.     the chars the user types.   Confusion reigns.
  40.  
  41.     P'raps 'kill -STOP old-app-pid', then the message, then
  42.     'kill -CONT old-app-pid'   ?    Arrghh  :-)
  43.  
  44. *   The screen handling stuff (approximately curses) built into Informix
  45.     relies knowing what the screen looks like.   If you write on
  46.     the screen, the app's memory image doesn't match the screen
  47.     and all subsequent display is corrupted.
  48.  
  49.     You can get round this by redisplaying the screen, but this 
  50.     has to be a user action ([s]he presses the 'Redisplay' key).
  51.     Don't believe you'll be able to signal the original app to
  52.     redisplay the screen.
  53.  
  54. *   The screen modes have to be saved and restored either side
  55.     of your message.
  56.  
  57. > Alternatively, we could have a status line either on the top or the bottom
  58. > of the screen and display the messages there - would this be possible and
  59.  
  60. If you've got 25-line terminals, and the Informix (JYACC JAM ?) screens
  61. only use 24 lines and ignore the 25th (it's managed separately from the
  62. other 24), you shouldn't have a  problem with doing it that way.
  63. Just write on the 25th line.   Mind you, you still can't get chars
  64. back from the user ...
  65.  
  66. > if so, could it be terminal-type independent?
  67.  
  68. If you use the status line approach, you're relying on a particular
  69. manufacturer's feature, so no.    It's easy to draw boxes in a 
  70. terminal-independent manner, but I don't see how you can read 
  71. the keyboard or redraw the screen satisfactorily afterwards.
  72.  
  73. If you've got source for the app, can you just add a function
  74. to do a readdir(3V) and a couple of stat(2V)s to see if
  75. things have changed  ?  Use the normal Informix stuff to 
  76. pop up a prompt window and call the function on a reasonably 
  77. regular basis (e.g. once whenever a new screen is displayed).
  78.  
  79. > Thanks in advance,
  80. >
  81. > Richard Ridley
  82.  
  83. Don't suppose that helps any, sorry 'bout that.  Any better ideas out there ?
  84.  
  85. Your normal programming will now be resumed.
  86.  
  87. Cheers - Tony.
  88.  
  89. PS.  Nip down to Rowans for a couple of Grolsches for me, would ya ?  Ta.
  90. _________________________________________________________________________
  91. Tony Heskett                 th@bnr.co.uk       Phone: (+44) 279 402637
  92. BNR, London Road, Harlow, Essex  CM17 9NA       Fax:   (+44) 279 451434
  93.