Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
To all you wonderfully helpful people out there...
Here's the kind of thing that I'm trying to do... Imagine a DCL procedure that looks roughly like this...
$ ! P1 = explicit filespec
$ SET NOON
$ !
$ LOOP:
$ FIL = F$SEARCH(P1)
$ IF FIL .EQS. ""
$ THEN
$ WAITFORIT 'P1' ! The nice utility
$ ELSE
$ GOSUB PROCESSIT
$ ENDIF
$ GOTO LOOP
$ !
$ PROCESSIT:
$ OPEN/READ FILLOG 'FIL'
$ IF $STATUS
$ THEN
$ CLOSE FILLOG
$ !Do something or other with the 'FIL'
$ DELETE/NOLOG/NOCONFIRM 'FIL';
$ RETURN
$ ENDIF
$ WAIT 00:00:10
$ GOTO PROCESSITWhat I'm after is the "WAITFORIT" utility above...
I found a program (written in C) that used AST's to accomplish this... trouble is... I misplaced the link. Now, I can't seem to track it down.
Does anyone know where I might find it? If not, does anyone have an example (preferably in C) that set's an AST to wait for a file creation... or even to detect some kind of update activity in a given directory?
Thank you!
--Doc
PS... Hmmm... lost my indenting. :-(

Doc,
ASTs would be the correct way to do this, but the question is "An AST on what?".
File creation in and of itself will not trigger an AST. There are various ways of identifying when something has changed, but that is not precisely what you are asking.
Declaring a Timer AST, and then attempting to open the file is precisely what you have in your code example. A session that I presented at a past DECUS symposium, "Introduction to AST Programming" (notes at http://www.rlgsc.com/cets/2000/435.html ), may prove useful.
- Bob Gezelter, http://www.rlgsc.com

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |