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)
);