On 22 Apr 2015, at 9:40pm, John McKown <john.archie.mckown at gmail.com> wrote:
> ?only his app has access to this directory, > so there are no worries about "somebody else" putting files in it. So I am > _guessing_ that there are files in that directory which need to persist > between executions of his application. Correct. > Now, if the OP can verify that only > one instance of his app can run at a time (which means only that execution > instance can create/update/delete files in the directory while that > instance is running), Correct. > then perhaps it would be possible for the app to keep > a list of all file names in the given directory which exist before he > starts up the SQLite portion of the application. Then, after he closes out > the SQLite portion of the application, he again scans the directory again > and deletes all files in the directory which did not exist at the time of > the initial scan. This might work in a single threaded, single use at a > time, type application. It would not work if multiple copies/instances of > the app can run concurrently (hopefully using different SQLite data bases).? The app itself can create and delete other files while it runs. When it is quit it is possible that some files which previously existed have been deleted and others created. These files are not SQLite-related files and can be in a few different formats. But a variation on your solution is workable: the app keeps a perfect record of which files should exist in its folder and deletes everything it doesn't know about before quitting. A strange sort of thing to do but in some situations, maybe this one, it makes sense. I'll ponder it. Simon. PS: Well done Graham.