Hi All:
It's been quite a while since I posted my last puzzle. I thought it time
to renew the effort. I have the answer and will post it next week. Let's
see if you can figure it out.
You have an application which stores data in various subdirectories under
it. You use SET DEFAULT TO to enter each subdirectory for its local
processing. While there you might sort, search and SQL-SELECT. To be
brief, any old data manipulation process you care to name. When done,
you have your application return to the parent directory where the app
resides.
Another feature of your application is that it will remove a directory.
Isn't RD wonderful? Of course, you cannot remove a directory that is
not empty. So, your application includes a loop similar to the following:
jnFiles = ADIR( jaDumpIt, "subdir\*.*" ) && subdir = where data resides
IF jnFiles > 0 && ~~~~~~
FOR jj = 1 TO jnFiles
ERASE jaDumpIt[ jj, 1 ]
NEXT
ENDIF
Alas! Although this nearly always works, sometimes you get a File is
Open error. So you insert a CLOSE DATA statement prior to the loop.
No good. The file in question is a .TMP file that Fox is using.
You want the application to delete the files and remove the directory.
You don't trust the user to do this in Windows or DOS. (Do you?)
Your mission, should you decide to accept it, is to reply to me this week
with a solution -- elegant or otherwise. I'll post mine next week. It
may surprise some of you....until you think about it a second.
David in Dallas.
--- Maximus/2 3.01
---------------
* Origin: * MacSavvy OS/2 BBS * Dallas, Texas * 972-250-4479 * (1:124/1208)
|