"Error saving document"
-
Hi, I have a small problem.I generated a pdf file with some temperory name and later i am renaming the file.When i am trying to rename the file using FileSystem.Rename, i get an exception "Error saving document". I don't understand why am i getting this error.I checked if my file is already open, but it was not. Please do let me know if you have any ideas. Thnx in advance.
-
Hi, I have a small problem.I generated a pdf file with some temperory name and later i am renaming the file.When i am trying to rename the file using FileSystem.Rename, i get an exception "Error saving document". I don't understand why am i getting this error.I checked if my file is already open, but it was not. Please do let me know if you have any ideas. Thnx in advance.
If you have touched the file it is possible that you are maintaing a connection to the file and therefore it is in use. Make sure you have destroyed/closed all the objects/methods you used to create the file before renaming.
Never underestimate the power of human stupidity RAH
-
If you have touched the file it is possible that you are maintaing a connection to the file and therefore it is in use. Make sure you have destroyed/closed all the objects/methods you used to create the file before renaming.
Never underestimate the power of human stupidity RAH
-
Firstly, Thnx for the reply. I haven't touched the file and i have destroyed all the objects related to it, yet i get the same error.I just dont get what the problem might be. :(
make sure any handles you have to the file system are closed and not just cleared. From memory of you clear a file reference it goes to GC, and the handle can still be 'open' until it is destroyed. That is why you should always explicitly close any file streams.
Panic, Chaos, Destruction. My work here is done.