https://bugzilla.novell.com/show_bug.cgi?id=684172

https://bugzilla.novell.com/show_bug.cgi?id=684172#c0


           Summary: System.IO.File.Delete doesn't work
    Classification: Mono
           Product: MonoDroid
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
          Found By: ---
           Blocker: ---


System.IO can be used to create a file:

var storage = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath;
var file1 = Path.Combine (storage, "Download", "test.txt");

System.IO.FileStream fs = System.IO.File.Create (file1);
fs.Close ();


However, it cannot be used to delete a file:

System.IO.File.Delete (file1);

Fails with:
Access to the path "/mnt/sdcard/..." is denied.


You can successfully delete the file using Java APIs:

var fs2 = new Java.IO.File (file1);
fs2.Delete ();

Note you need the "android.permission.WRITE_EXTERNAL_STORAGE" permission in
your manifest.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to