View Single Post
Old 30 April 2021, 19:45   #6
KONEY
OctaMED Music Composer
 
KONEY's Avatar
 
Join Date: Jan 2009
Location: Venice - Italy
Age: 49
Posts: 667
daxb suggestion turned out to be of great value, with the power of ARexx do what I needed was as simple as this:

Code:
/* watch a file and execute it, useful to test code compiled externally */

SAY "WATCH A FILE FOR CHANGES AND EXECUTE IN CASE"
SAY "ARexx script by KONEY 2021"
SAY "--------------------------------------------------"

library = 'rexxsupport.library'
IF ~SHOW( 'L', library ) THEN DO
	IF ~ADDLIB( library, 0, -30, 0 ) THEN DO
		SAY 'Failed to add library ' || library || '.'
		EXIT 10
	END
END

initial_file =  STATEF("j")
SAY initial_file 
loop=1
SAY "WATCHING..."
DO until loop > 1
	actual_file =  STATEF("j")
	IF actual_file ~=  initial_file THEN	DO
		SAY "CHANGES DETECTED!"
		ADDRESS COMMAND  "J  >NIL:"
		initial_file =  STATEF("j")
		END
END

EXIT
KONEY is offline  
 
Page generated in 0.04845 seconds with 11 queries