CADS_COLE@GALLUA.BITNET.UUCP (09/24/87)
To all who replied (Joel <JMS@ARIZMIS.BITNET>, Seldon <SYSTEM@CRNLNS.BITNET>, Claude <BARBE%sdr.slb.com@RELAY.CS.NET>, Nigel <SYSMGR@IPG.PH.KCL.AC.UK>, and others): Many thanx. It may not be elegant or fast, but it's easy to understand and it works. And that's all I was looking for. In particular, Seldon had pretty much done exactly what I wanted and Claude explained it before I received Sheldon's message. The final product below: ------------------------------------------------------------------------------- $ IF F$SEARCH("SYS$MANAGER:NOTICE.TXT") .EQS. "" THEN GOTO NONEWS $ X = F$CVTIME(F$FILE_ATTRIBUTES("SYS$MANAGER:NOTICE.TXT","RDT"),"COMPARISON") $ Y = F$CVTIME(F$FILE_ATTRIBUTES("SYS$LOGIN:LOGIN.COM","RDT"),"COMPARISON") $ IF X .LES. Y THEN GOTO NONEWS $ MORE SYS$MANAGER:NOTICE.TXT $! $ NONEWS: $ SET PROT=('F$FILE_ATTRIBUTES("SYS$LOGIN:LOGIN.COM","PRO")') - $ SYS$LOGIN:LOGIN.COM -------------------------------------------------------------------------------- Kevin Cole <Flatline> BITNET: KJCOLE@GALLUA.BITNET Center for Assessment and or Demographic Studies (CADS) CADS_COLE@GALLUA.BITNET Gallaudet Research Institute (GRI) UUCP: ...!psuvax!gallua.bitnet!kjcole Gallaudet University CompuServe: 76167,1406 Washington, D.C. 20002 (202) 651-5575 "Hey Rocky! Watch me pull a rabbit out of my hat!"
leichter@VENUS.YCC.YALE.EDU ("Jerry Leichter") (09/28/87)
... Many thanx. It may not be elegant or fast, but it's easy to understand and it works. And that's all I was looking for. In particular, Seldon had pretty much done exactly what I wanted and Claude explained it before I received Sheldon's message. The final product below: ---------------------------------------------------------------------- $ IF F$SEARCH("SYS$MANAGER:NOTICE.TXT") .EQS. "" THEN GOTO NONEWS $ X = F$CVTIME(F$FILE_ATTRIBUTES("SYS$MANAGER:NOTICE.TXT","RDT"), - "COMPARISON") $ Y = F$CVTIME(F$FILE_ATTRIBUTES("SYS$LOGIN:LOGIN.COM","RDT"), - "COMPARISON") $ IF X .LES. Y THEN GOTO NONEWS $ MORE SYS$MANAGER:NOTICE.TXT $! $ NONEWS: $ SET PROT=('F$FILE_ATTRIBUTES("SYS$LOGIN:LOGIN.COM","PRO")') - $ SYS$LOGIN:LOGIN.COM ---------------------------------------------------------------------- There is one (significant) problem with this solution: If a user decides to edit his LOGIN.COM file, he will change its revision date, causing it to appear that he last logged in later than he actually did. He will then miss messages. That is: Suppose I log in at 1:00. At 2:00, NOTICE.TXT is up- dated. At 3:00 I update my LOGIN.COM file. When I next log in, the 3:00 modification time on my LOGIN.COM file is compared to the 2:00 modification time on NOTICE.TXT, and I am NOT shown the new notice. You should instead use a file that the user is not likely to touch. The easiest thing to do is to create a 0-length file in the user's SYS$LOGIN directory, with a name like "LAST.LOGIN". Teach your users to leave this file alone. (If they screw around with it, they will only be hurting them- selves...the system-wide login file would re-create LAST.LOGIN if it found that it didn't exist, and of course display NOTICE.TXT.) -- Jerry ------
bruceb@telesoft.UUCP (Bruce Bergman @spot) (09/30/87)
In article <8709291030.AA13927@ucbvax.Berkeley.EDU>, (Jerry) writes: > You should instead use a file that the user is not likely to touch. The > easiest thing to do is to create a 0-length file in the user's SYS$LOGIN > directory, with a name like "LAST.LOGIN". Teach your users to leave this > file alone. (If they screw around with it, they will only be hurting them- > selves...the system-wide login file would re-create LAST.LOGIN if it found > that it didn't exist, and of course display NOTICE.TXT.) > > -- Jerry > ------ How about using the root level directory for that user? It's likely to never change over the course of a user's life, and it's pretty easy to determine which filename we're talking about ([000000]'name'.DIR;). Just a thought. Bruce bergman -- allegra!\ TeleSoft, Inc. gould9! \ crash!--\ (619) 457-2700 x123 ihnp4! \ \ >--sdcsvax!---->--telesoft!bruceb (Bruce Bergman N7HAW) nosc! / / scgvaxd! / log-hb!--/ 5959 Cornerstone Court West ucbvax! / San Diego, CA. 92121-9891 All expressed opinions belong to "Bill the Cat" or me. :^)