Tell OS to refresh?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way, say after a file has been renamed using code, to force the
operating system to refresh so that it recognizes the change in the file name?

Or do I need to pause my code for a few seconds to give it time to do this?

Thanks much in advance.
 
A file is renamed by saving it with a new name. The OS shouldn't have to
refresh since part of saving it includes writing that information to the
directory.

What are you trying to do that is causing problems?
 
I am working on a utility for users to re-organize large numbers of files. It
allows the user to select multiple files in a folder (using file picker). The
utility then prompts for a new name. The program loops through the array of
file names and changes the name of each file to the new name and appends a
new sequential number at the end.

I was getting an error indicating that a file with that name already exists,
even though the counter was incrementing, but I just found an error in my
code that fixed it.

Sorry - please disregard. Thanks for your time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top