[android-developers] Re: Why File.mkdirs() can not succeed?
Please don't hard-code that path and use the appropriate API in Context instead, so that your app continues to work if/when that path changes. JBQ On Wed, Dec 17, 2008 at 4:23 AM, shuoshuo wzshuos...@gmail.com wrote: Yes, I see, I create file on /data/data/mypackagename/ could succeed. Thanks all . On 12月17日, 上午12时21分, Jean-Baptiste Queru j...@google.com wrote: You're trying to write in a location (/data) where your app doesn't have write permissions. JBQ On Mon, Dec 15, 2008 at 10:04 PM, shuoshuo wzshuos...@gmail.com wrote: I use new File(/data/mydir/tmp).mkdirs() to create dir mydir and tmp, but it can not be created, does anyone using File.mkdirs() in android. -- Jean-Baptiste M. Queru Android Engineer, Google. -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Why File.mkdirs() can not succeed?
Yes, I see, I create file on /data/data/mypackagename/ could succeed. Thanks all . On 12月17日, 上午12时21分, Jean-Baptiste Queru j...@google.com wrote: You're trying to write in a location (/data) where your app doesn't have write permissions. JBQ On Mon, Dec 15, 2008 at 10:04 PM, shuoshuo wzshuos...@gmail.com wrote: I use new File(/data/mydir/tmp).mkdirs() to create dir mydir and tmp, but it can not be created, does anyone using File.mkdirs() in android. -- Jean-Baptiste M. Queru Android Engineer, Google. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Why File.mkdirs() can not succeed?
We're using it to make directories on the SD card with no trouble. Can you make those directories by hand via the adb shell ? R On Dec 16, 6:04 am, shuoshuo wzshuos...@gmail.com wrote: I use new File(/data/mydir/tmp).mkdirs() to create dir mydir and tmp, but it can not be created, does anyone using File.mkdirs() in android. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Why File.mkdirs() can not succeed?
Sorry, you can create something in /data/data/package.of.your.app/. Basing on what I see in abd shell, owner of /data/ directory is system and a group is system. Moreover, there's no permission to read/ write for others, so you can't create something there. /data/data/ has the same properties. Only in /data/data/package.of.your.app/ is writable to apps. On Dec 16, 10:26 am, szeldon szeldon@gmail.com wrote: Are you sure that an application can create a new directory in /data? I know that you can create files/directories in /data/ package.of.your.app/ but I'm not sure if you can create something in / data. Check permissions by using adb shell or by using some method in File class. On Dec 16, 7:04 am, shuoshuo wzshuos...@gmail.com wrote: I use new File(/data/mydir/tmp).mkdirs() to create dir mydir and tmp, but it can not be created, does anyone using File.mkdirs() in android. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Why File.mkdirs() can not succeed?
You won't be able to create a directory or any files in /data. Besides that's the phone memory. You probably want to do this on the SD card instead. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---