[Mono-list] Delete File on Android

Rodrigo Kumpera kumpera at gmail.com
Tue Sep 6 18:23:47 EDT 2011


This is a bug in the mono runtime that requires a file to be user writeable
to allow it to be deleted.

A fix is in the works and will be part of the next release of Mono for
Android.

As a workaround, set your file to u+w and Delete will work.


On Mon, Sep 5, 2011 at 6:50 AM, Kuehner <kuehner at initions.com> wrote:

> Hi!
>
> I created a file on a sd card with following commands:
>
> FileStream fs = new FileStream(mGpsTripPath, FileMode.OpenOrCreate,
> FileAccess.ReadWrite);
> StreamWriter sw = new StreamWriter(fs, Encoding.Unicode);
> sw.Write(content);
> sw.Flush();
> fs.Close();
> sw.Close();
>
> Now I am not able to delete that file anymore (for example with
> File.Delete(mGpsTripPath);). The only way I´m able to delete this file is
> to
> read the content of the sd card with Windows.
>
> I think that many applications need to create and delete files... but how
> do
> I do that with mono?
>
> Thanks for your help!
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Delete-File-on-Android-tp3790850p3790850.html
> Sent from the Mono - General mailing list archive at Nabble.com.
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20110906/d56bf2dd/attachment.html 


More information about the Mono-list mailing list