Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!sdcsvax!ucbvax!VENUS.YCC.YALE.EDU!leichter From: leichter@VENUS.YCC.YALE.EDU ("Jerry Leichter") Newsgroups: comp.os.vms Subject: re: Thanx! (Last LOGIN date vs. file modification date) Message-ID: <8709291030.AA13927@ucbvax.Berkeley.EDU> Date: Mon, 28-Sep-87 16:08:00 EDT Article-I.D.: ucbvax.8709291030.AA13927 Posted: Mon Sep 28 16:08:00 1987 Date-Received: Wed, 30-Sep-87 06:44:50 EDT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: "Jerry Leichter" Organization: The ARPA Internet Lines: 37 ... 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 ------