Re: How to Access the SD File System?
WoodManEXP <woodmanexp <at> gmail.com>
2009-09-02 19:41:17 GMT
You are right, I am accessing the /sdcard/ via Java and my plan is to
begin accessing through JNI. I have seen posts that say it may be
possible to pass an open FileInputStream to the JNI and get the fd
from it. But there are fre more steps remaining to get the NDK going
before I get to that part. Sorry to not be of more help at this point.
BTW, are you on Windows and if so what are you using to edit the C
On Sep 2, 1:32 pm, James SDC <hanzon... <at> gmail.com> wrote:
> Hi PK,
> Thank you very much for your information. I have figured out the file
> access to the SD card in Java. Basically, it is working without root
> access necessary.
> Hi WoodManEXP,
> Are you using Java or JNI to access the file on SD card? It sounds to
> me that you are using Java. The problem I have is to use JNI to access
> the file.
> First of all, I try to use fopen() to open an existing file on SD
> card, then I want to use fread() to read the file, and use fwrite() to
> write to the file.
> Let say I call fopen("/sdcard/mytest.dat", "r+") to open the existing
> file. On HTC Hero, I got errno = 13, which is permission denied. Then
> I change the phone image and grant the root access according to some
> sayings on the Internet. After that, the fopen() returns me success,
> but fread() returns me errno = 2, which is "no such file or
> The error of fread() totally does not make sense to me, and I wonder
> if it is caused by the phone image change.
> WoodManEXP, what is your experience with this, and how do you exactly
> do to access the file from JNI? Thank you in advance!
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-ndk <at> googlegroups.com
To unsubscribe from this group, send email to android-ndk+unsubscribe <at> googlegroups.com
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en