/*********************************************************** * * * Reindexing Daemon CPL Utility * * * * This program cycles the specified directory * * and reindexes all resident databases. * * The program runs until stopped by user keypress. * * * * Specify the directory in the "reindexDaemon" * * function below, line 26. * * * * (C) Copyright Dataflight Software, Inc. 1995. * * All Rights Reserved. * * * ***********************************************************/ int TRUE = 1, FALSE = 0, ESC = 27; main() { closedb(0); puts(0,0,"Concordance Reindexing Daemon"); while(TRUE) { reindexDaemon("C:\Concor_7\Database\"); } } /* main() */ reindexDaemon(text directoryPath) { char string[128]; int db, i; string = findfirst(directoryPath+"*.DCB", 0); while(string <> "") { Message("Press [Esc] to quit now.", FALSE); i = clock() + 3000; while(i > clock()) { if (keypress()) if (getkey() == ESC) exit(); } Message("Reindexing "+directoryPath+string, FALSE); db = opendb(directoryPath+string); reindex(db); closedb(db); string = findnext(); } } /* reindexDaemon() */ /**************************************************************** * Name: Message * * Synopsis: Displays error message and waits for key. * ****************************************************************/ Message(text message; int wait) { text screen; int key; cursoroff(); if (wait) screen = save(5,13,8,69); box(5,13,8,69, "3D", MenuColor_); puts(6,14,pad(message,'C',53),MenuColor_); if (wait) { key = getkey(); restore(5,13,screen); } return(asc(upper(chr(key)))); } /* Message() */