midora Posted October 11, 2011 Share Posted October 11, 2011 Sometimes when I try to save an image I'm getting this message. The reason is that the image is open in an other destination. Would it be possible to implement a more informative error message in this case? Typically Windows throws an access error when you try to open the file for write in this case. I guess it is a Paint.NET issue and not one in the filetype plugins. My understanding is that filetype plugins are writing to a stream which stores the data in a .tmp file. After that Paint.NET copies the temp file to the destination file and throws the i/o error. Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted October 12, 2011 Share Posted October 12, 2011 Version 4.0 will improve on this somewhat. The problem here is that any type of "I/O error" is reported using the IOException type. Further details are only provided in a localized manner, e.g. as text meant for the end-user. I can't really detect, programmatically at least, and in a non-fragile manner, what type of I/O error there was. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
midora Posted October 12, 2011 Author Share Posted October 12, 2011 Version 4.0 will improve on this somewhat. The problem here is that any type of "I/O error" is reported using the IOException type. Further details are only provided in a localized manner, e.g. as text meant for the end-user. I can't really detect, programmatically at least, and in a non-fragile manner, what type of I/O error there was. That's an improvement for sure. Thanks. I'm not an C# expert but I would expect that the HResult property of IOExeption provides the access error code. Best solution for this problem may be a test of the access state before the save configuration dialog is shown. Simular to the test whether the destination file exists already. Which shows the "Do you want to replace it?" message box. (OK this messagebox is part of the file selector). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.