Did the SD card get mounted read-only? Somehow that happened on my
phone and I have no idea how. Google Listen started reporting that
none of my podcasts could download because of SD card read only. I
opened up the terminal emulator and ran mount and sure enough "ro". I
am not sure how this happened. I am running CyanogenMod 6 RC2, so
maybe I deserved it. This could explain why it didn't work. Rebooting
my phone fixed the SD card issue, it mounted in normal readwrite mode
again.

-E

On Aug 6, 3:13 pm, john brown <johnbrowngreybe...@gmail.com> wrote:
> Hello,
>
> I am using Android 2.1 update 1, API level 7, Eclipse, and HVGA skin.
>
> When the AVD is running, I check settings > sdcard total 49.21MB,
> available 49.07MB.
>
> Programatically checking Environment.getExternalStorageState() equals
> MEDIA_MOUNTED which I think means that the sdcard is available and
> writeable.
>
> I use getExternalStorageDirectory() to establish the sdcard root
> directory.
>
> I copied the files on the sdcard with adb push source destination.
>
> I am able to successfully read other files in that directory.
>
> code to write to file:
> //*****************************************
>
> File fFile = new File(pathFile);
> if (fFile.exists()){ ... // returns true
> if (fFile.canRead()){ ... // returns true
> if (fFile.canWrite()){ ... // returns false
>
> try{
>         FileWriter Fw = new FileWriter(fFile, true);
>         BufferedWriter Bw = new BufferedWriter(Fw);
>         PrintWriter outPw = new PrintWriter(Bw, true);
>         outPw.println(strRec);
>         outPw.close();}
>
> catch(IOException ex){
>         System.out.println("IO Error - " + ex.toString());
>         System.exit(0);
>
> }
>
> //************************************
> System.out shows:
> IO Error - java.io.FileNotFoundException
>
> but we know the file is there from the preceding checks:
> if (fFile.exists()){ ... // returns true
> if (fFile.canRead()){ ... // returns true
>
> What do I need to do to make the file writable?
> Or
> I want to write to the file. What am I doing wrong?
>
> Thanks, John Brown

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

Reply via email to