How to read/write data to mounted sdcard
<p>is there any way to write data to a sdcard when the card is mounted as a disc via usb?</p>

<p>I get an permission denied exception. If I unplug it everything is fine.</p>

<p>I know I should be using Environment.getExternalStorageDirectory, but I don't think this would make any difference.</p>

<p>Code:</p>

<pre><code>        File file = new File("/sdcard/Test/test.txt");

        BufferedOutputStream buf = new BufferedOutputStream(
                 new FileOutputStream(file,true));

         buf.write(str.getBytes());
</code></pre>

<p>Thanks,</p>

<p>Nicholas</p>
