[mono-android] Deleting files on external storage?
Jon Valvatne
jon at norsync.com
Wed Mar 30 11:45:47 EDT 2011
Yep, this works.
On Wed, Mar 30, 2011 at 4:58 PM, Jonathan Pobst <monkey at jpobst.com> wrote:
> I think we are going to have to do something on the backend to fix this.
> Can you see if the following works for you?
>
> Instead of:
>
> System.IO.File.Delete (file);
>
> try:
> var fs = new Java.IO.File (file);
> fs.Delete ();
>
> Jonathan
>
>
> On 3/30/2011 1:55 AM, Jon Valvatne wrote:
>
>> On Tue, Mar 29, 2011 at 5:25 PM, Mike Kestner <mkestner at novell.com
>> <mailto:mkestner at novell.com>> wrote:
>>
>> What does the output of context.GetExternalFilesDir point at, and can
>> you guys create AND delete files created there?
>>
>> In my case Android.OS.Environment.ExternalStorageDirectory is set to
>> /mnt/sdcard, and trying to create/delete /mnt/sdcard/test.txt still
>> fails on the delete in the same way.
>>
>> So the latest test case is:
>>
>> String file =
>> Android.OS.Environment.ExternalStorageDirectory.AbsolutePath +
>> "/test.txt";
>> System.IO.FileStream fs = System.IO.File.Create(file);
>> fs.Close();
>> System.IO.File.Delete(file);
>>
>>
>>
>> _______________________________________________
>> Monodroid mailing list
>> Monodroid at lists.ximian.com
>>
>> UNSUBSCRIBE INFORMATION:
>> http://lists.ximian.com/mailman/listinfo/monodroid
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/mailman/private/monodroid/attachments/20110330/efd9d31d/attachment.html
More information about the Monodroid
mailing list