Delete the folder from the sd card

Dependencies:   SDFileSystem mbed

Fork of delete_file by Testbed

Files at this revision

API Documentation at this revision

Comitter:
jaspreetsingh
Date:
Mon Feb 16 12:28:30 2015 +0000
Parent:
6:e8cd76f38fa9
Child:
8:99956653b8c8
Commit message:
Delete_file prog

Changed in this revision

SDFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Mon Feb 16 12:28:30 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Testbed/code/SDFileSystem/#7b35d1709458
--- a/main.cpp	Fri May 09 19:58:03 2014 +0300
+++ b/main.cpp	Mon Feb 16 12:28:30 2015 +0000
@@ -1,12 +1,26 @@
 #include "mbed.h"
+#include "SDFileSystem.h"
 
-DigitalOut myled(LED1);
+
+SDFileSystem sd(PTE3, PTE1, PTE2, PTE4, "sd");
+Serial pc(USBTX, USBRX);
 
-int main() {
-    while(1) {
-        myled = 1;
-        wait(0.2);
-        myled = 0;
-        wait(0.2);
-    }
-}
+int main()
+{
+    mkdir("/sd/jas",0777);
+    pc.printf("Hello World\r\n");
+    wait(3);
+    pc.printf("Creating test1.txt\r\n");
+    FILE *fp = fopen("/sd/test1.txt","w");
+    fprintf(fp,"Hello World");
+    fclose(fp);
+    pc.printf("File Created\r\n");
+    wait(3);
+    pc.printf("Deleting the File\r\n");
+    wait(3);
+    char dest[100]="";
+    sprintf(dest,"/sd/test1.txt");    // Write the name of the file you want to delete from the sd card or empty folder
+    remove(dest);
+    pc.printf("File Deleted\r\n");
+        
+}
\ No newline at end of file
--- a/mbed.bld	Fri May 09 19:58:03 2014 +0300
+++ b/mbed.bld	Mon Feb 16 12:28:30 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae
\ No newline at end of file