It is most likely because your application does not have the correct permissions to open that file.
Solution.
Try running your application/IDE as admin by right-clicking on it and selecting the "Run as administrator" option.
Notes.
It is not a common use case of most applications to write directly into C: drive and there is no trivial method around this. You either start your application with the correct permissions or you move your file elsewhere.
If you absolutely must do this then you can start your application as admin, read/modify your file(s) and then drop your application's privileges.