Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Dec : MkDir: Permissions not being set

www.cryer.info
Managed Newsgroup Archive

MkDir: Permissions not being set

Subject:MkDir: Permissions not being set
Posted by:"Mark Smith" (marksmi..@jungle-monkey.com)
Date:Thu, 20 Dec 2007 18:07:50

Hi,

I am trying to create a new directory and save a file inside it like this:

{$IOChecks off}
MdDir('test');
MdDir('test\test2');
{$IOChecks on}

jpeg.SaveToFile('test\test2\file.jpg');

However I am getting an access denied error message. Although my user
has full access to the application directory itself. That permission is
not being inherited by the new sub directories.

Do you know how I could set this? Even ensuring that the "Everyone"
group has full access would be good enough as the data is not at all
sensitive.

I have also tried this with a CreateDirectory('test\test2',NIL) API call
and had the same problem.

I would try replacing NIL with a PSECURITYDESCRIPTOR type but I am not
sure how to go about this.

Thanks for any help,

Mark

Replies:

www.cryer.info
Managed Newsgroup Archive