So a quick way to determine if you can write a file, which can use even from the debugger is to use something like:
System.IO.Directory.GetAccessControl(@"<filename>").GetAccessRules(true,true,typeof(System.Security.Principal.SecurityIdentifier))
This will return a list of access rules and you can examine them.
For each rule Check the AccessControlType==AccessControlType.Allow and not AccessControlType.Deny