permissions for mkdir

1,133 views
Skip to first unread message

Luiz Valdetaro

unread,
Sep 8, 2011, 9:57:14 AM9/8/11
to andro...@googlegroups.com
Hi,

I have a need to have my C library to create subdirectories under the /data/data/package/files folder. My library attempts to use mkdir() , but it fails with errno 13 (Permission denied). DOes teh C library inherits the same permission from Java? I have sucessfully written stuff into the files folder from Java, but never attempted to create a directory from Java; Any ideas?

Luiz

David Turner

unread,
Sep 8, 2011, 10:03:13 AM9/8/11
to andro...@googlegroups.com
On Thu, Sep 8, 2011 at 3:57 PM, Luiz Valdetaro <lcval...@gmail.com> wrote:
Hi,

I have a need to have my C library to create subdirectories under the /data/data/package/files folder. My library attempts to use mkdir() , but it fails with errno 13 (Permission denied). DOes teh C library inherits the same permission from Java? I have sucessfully written stuff into the files folder from Java, but never attempted to create a directory from Java; Any ideas?

Yes, it does. Are you using absolute paths? There is no reason this shouldn't work. Which mode value are you using?

Luiz

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Luiz Valdetaro

unread,
Sep 8, 2011, 2:28:32 PM9/8/11
to andro...@googlegroups.com

Absolutely!  Your question about mode lead me to the solution. Thanks!

charles

unread,
Sep 10, 2011, 4:27:58 PM9/10/11
to andro...@googlegroups.com
What exactly was the solution?

Luiz Valdetaro

unread,
Sep 10, 2011, 9:51:10 PM9/10/11
to andro...@googlegroups.com

The mkdir() function has a mode argument. I was not using it.

On Sep 10, 2011 3:28 PM, "charles" <csbo...@gmail.com> wrote:
>
> What exactly was the solution?
>

> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.

> To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/jSh9bL9zrmcJ.


>
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

On Sep 10, 2011 3:28 PM, "charles" <csbo...@gmail.com> wrote:
>
> What exactly was the solution?
>

> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.

> To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/jSh9bL9zrmcJ.

Reply all
Reply to author
Forward
0 new messages