Macros write! error

I have error
Err(Os { code: 5, kind: PermissionDenied, message: "Отказано в доступе." })
What does it mean and what the reason of this?

If you paste the text into google translate, it says "access denied".

So the reason may be not appropriate file path in which I write, or... write! work with files, translators with words(which you also can explain).

There are many different things that can cause this error.

1 Like

Maybe you've File::open()ed the file and tried to write!().unwrap() to it?

https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.open

Attempts to open a file in read-only mode.
See the OpenOptions::open method for more details.

2 Likes

Yes, thanks much!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.