One very minor detail to note, in your test you weren't actually overwriting the original file that you opened, but instead Notepad appended a .txt to the filename, which is its default behavior, but you still got the same type or error because you didn't have write permission for any file in that directory.