FUNCTION DirectoryChange(path_to_dir) LOCAL is_changed LOCAL old_alias old_alias = ALIAS() IF .NOT. FILE(full_path_to_table + "DirChange.DBF") && Here You must create a table so CREATE DBF DirChange (F_NAME C(250), F_SIZE N(10), F_DATE D) INDEX ON UPPER(f_name) TAG DirChange ELSE SELECT 0 USE DirChange ORDER DirChange EXCLUSIVE && You must check If You can open that file exclusive ENDIF SELECT DirChange m1 = ADIR(aaaa,path_to_dir+"*.*") IF RECCOUNT("DirChange") # 0 FOR f_loop = 1 TO m1 SELECT DirChange SEEK UPPER(aaaa[f_loop,1]) DO CASE CASE .NOT. FOUND() *** Directory changed. There is an additional file on it. is_changed = .t. && You can use a numeric variable to know what exactly is changed CASE F_Size # aaaa[f_loop,2] *** Directory changed. The size of some file has been changed is_changed = .t. CASE F_Date # aaaa[f_loop,3] *** Directory changed. The date of some file has been changed is_changed = .t. ENDCASE NEXT ENDIF SELECT DirChange ZAP INSERT INTO DirChange FROM ARRAY aaaa IF .NOT. EMPTY(old_alias) SELECT (old_alias) ENDIF RETURN is_changed