Using FileWatcher seems to be a good approach. However, I need the
rest of the program to pause until a create-filename event occurs. Is
there another way of doing this besides using breaking from an
infinite while loop? Please tell me that there is, I am a firm
believer of the existence of elegant code
Define "pause". Typically, a GUI application isn't doing anything until
the user tells it to. There are exceptions, of course. Some applications
act as network clients or servers, for example, and even without direct
user interaction have certain ongoing processing. However, they are just
exceptions.
More importantly, it's not really possible to tell you how to "pause" your
application without knowing more about it. A typical GUI application
would not need "pausing", because it's not doing anything anyway. What is
it exactly that you mean by "pause", and what would your application be
doing if it were not "paused"?
Pete