Unset ReadOnly? (Basic BitWise Question!)
-
Hi. I am trying to leave all the other attributes of a file alone but unset read only. I am trying File.SetAttributes(strFileToStreamPath, File.GetAttributes(strFileToStreamPath) ^ FileAttributes.ReadOnly); which works fine if the file is read only but not if it isn't (it makes it read only!) How do I do a "OR NOT" sort of thing. I can't see any examples of this in the documentation? Cheers, Martin
-
Hi. I am trying to leave all the other attributes of a file alone but unset read only. I am trying File.SetAttributes(strFileToStreamPath, File.GetAttributes(strFileToStreamPath) ^ FileAttributes.ReadOnly); which works fine if the file is read only but not if it isn't (it makes it read only!) How do I do a "OR NOT" sort of thing. I can't see any examples of this in the documentation? Cheers, Martin
-
Thank You! I've just tried it and that works great!