Sometimes we have to wait for an external process to finish in order to continue with our code execution. Since it is external, processevents is no good, and sleep is the only solution. The problem is: sleep for how long? Sometimes an external or uncontrolled process depends on network speed, or different processors speed. We donít want to sleep for too long or too little. This is my simple solution:
stdio::write("I have seen the file"),!.