home *** CD-ROM | disk | FTP | other *** search
- /*
- ** $VER: EdgeLog.edge 1.3 (Sunday 08-Aug-93 02:47:08)
- **
- ** Log changes made to the files in Edge, _FE_User7 is used as 'changed flag'.
- ** F1 in _FE_UserFlags is used as log-file enable flag.
- ** You may specify the delay between each snapshot, if not given a delay of 6 minutes will be used
- ** Once this program is started it will stay in the background untill stopped by 'hi', e.g you
- ** don't have to restart it when you restart Edge.
- **
- ** Written by Thomas liljetoft
- */
-
- options results
-
- arg delay
-
- if length(delay) = 0 then delay = 6
-
- /* enter the main loop, to exit this you must use 'HI' */
- do forever
-
- /* check if Edge is present */
- if show('p','EDGE') ~= 0 then
- do
-
- address 'EDGE'
-
- /* get the address of the first file,
- if this fails the editor is very likely dormant, so don't do anything */
-
- 'addressof' top
- if RC = 0 then
- do
- first = result
- this = first
-
- /* get current date and time */
- 'getenvvar' _ge_date
- timestamp = result
-
- /* set current directory to that of Edge */
- 'getenvvar' _ge_currentdir
- call pragma(d,result)
-
- /* scan through all files and log changes */
- do forever
- address value this
-
- /* create log file for this file ?*/
- 'flag' _fe_userflags f1
- if result = 'Set' then
- do
-
- /* get full name of file */
- 'getenvvar' _fe_dosname
- filename = result
-
- /* get filesize, lines and changes */
- 'getenvvar' _fe_size
- filesize = result
- 'getenvvar' _fe_lines
- filelines = result
- 'getenvvar' _fe_changes
- filechanges = result
-
- /* add info to log file if file has changed since last check */
- 'getenvvar' _fe_user7
-
- if result ~= filesize','filelines','filechanges then
- do
- address command 'echo >>'filename'.edlog' '"DATE *"'timestamp'*" SIZE 'filesize' LINES 'filelines' CHANGES 'filechanges'"'
- 'putenvvar' _fe_user7 '"'filesize','filelines','filechanges'"'
- end
-
- end
-
- /* get the address of the next file */
- 'addressof' next
- this = result
- if this = first then leave
- end
- end
- end
-
- address command wait delay min /* go to sleep until next snapshot */
-
- end
-
-