1

I have an application that reads the contents of a file. While the program is running, it is checking the .lastModified() of that file, and when it has been modified, it reloads the contents of the file. This all seems to be working properly.

If I have that external file open in Eclipse and save the file, I receive an error stating: "The requested operation cannot be performed on a file with a user-mapped section open".

If I open the same file in, say, textpad, I can save the file just fine and see the reloaded results in my application.

Why does this happen and how can I get around it in Eclipse?

Charlie Mulic
  • 199
  • 2
  • 12
  • The same problem has been discussed here on SO, make a search with your error message. It seems it;s rather os specific than ide specific. http://stackoverflow.com/questions/1302698/system-io-exception-error-the-requested-operation-cannot-be-performed-on-a-fil http://stackoverflow.com/questions/1047616/whats-wrong-when-the-requested-operation-cannot-be-performed-on-a-file-with-a – zeller Sep 16 '12 at 18:15

1 Answers1

-1

Just happened to me on Windows 10. I use Eclipse but sometimes I modify the file with Emacs. It happens that the "A" attrib was set for the file. I have solved by running

attrib -A <filePath>

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 22 '22 at 11:51