View Single Post
Old Jul 12th, 2007, 8:06 AM   #3
john Wesley
Hobbyist Programmer
 
john Wesley's Avatar
 
Join Date: May 2006
Location: United Kingdom
Posts: 119
Rep Power: 3 john Wesley is on a distinguished road
Send a message via MSN to john Wesley Send a message via Yahoo to john Wesley
Yeah the chances are the directory should already exist - so if you create it, then alter access rules it should work, if you as the user running the program have the rights to do so.

try something like this, although its in C# should be easy to translate, if you need help tell me...

            
            DirectoryInfo di = Directory.CreateDirectory("Test");
            DirectorySecurity ds = di.GetAccessControl();
            ds.AddAccessRule(new FileSystemAccessRule(
                "MyUser", FileSystemRights.FullControl, AccessControlType.Allow)
            );
__________________
Mona Lisa must of had the highway blues you can tell by the way she smiles..
john Wesley is offline   Reply With Quote