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 <[email protected]> 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 - [email protected] > http://lists.ximian.com/mailman/listinfo/mono-list >
_______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
