Jump to content

An i/o error occured when writing to the file


midora

Recommended Posts

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.

midoras signature.gif

Link to comment
Share on other sites

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.

post-44714-131838334237_thumb.png

post-44714-131838334751_thumb.png

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

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).

midoras signature.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...