> Hi,
>
> What is the proper way to determine if I have write-access to a given
> directory?
Get first a DirectoryInfo object using:
DirectoryInfo di = new DirectoryInfo(@"c:\MyDir");
then, call di.GetAccessControl() (or the overload).
FB

Signature
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Bit Twiddler - 27 Dec 2005 16:10 GMT
DirectoryInfo.GetAccessControl() returns a DirectorySecurity object:
DirectoryInfo di = new DirectoryInfo(@"c:\MyDir");
DirectorySecurity ds = di.GetAccessControl();
Now I can call ds.AccessRightType, but I don't understand why this returns a
Type, instead of a mask representing the FileSystemRights enumeration.
If I could get those flags I could just check for
FileSystemRights.CreateFiles, etc.
Any pointers would be appreciated!
Thanks,
BT
>> Hi,
>>
[quoted text clipped - 7 lines]
>
> FB