[mono-android] Deleting files on external storage?

Jon Valvatne jon at norsync.com
Tue Mar 29 05:06:41 EDT 2011


Oops - looks like I created a too-simple test case. This also fails in the
same way, though:

                System.IO.FileStream fs =
System.IO.File.Create("/sdcard/test.txt");
                fs.Close();
                System.IO.File.Delete("/sdcard/test.txt");

On Tue, Mar 29, 2011 at 11:00 AM, Jb Evain <jbevain at gmail.com> wrote:

> Hi,
>
> On Tue, Mar 29, 2011 at 10:51 AM, Jon Valvatne <jon at norsync.com> wrote:
> >                 System.IO.File.Create("/sdcard/test.txt");
> >                 System.IO.File.Delete("/sdcard/test.txt");
> >
> > Has anyone successfully deleted a file off external storage from C# code?
>
> Have you properly disposed the created file stream (using either the
> Close or Dispose method, or the using pattern on it) before trying to
> delete the actual file?
>
> Jb
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/mailman/private/monodroid/attachments/20110329/59af85e0/attachment-0001.html 


More information about the Monodroid mailing list