Add basic change for v1453
Change-Id: I9497a61bbc3717f66413794a4e7dee0347c0bc33
diff --git a/mbtk/test/others/partition_write_demo.c b/mbtk/test/others/partition_write_demo.c
new file mode 100755
index 0000000..5edfa2d
--- /dev/null
+++ b/mbtk/test/others/partition_write_demo.c
@@ -0,0 +1,56 @@
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+int main(int argc, char *argv[])
+{
+
+#if 1
+ // 100K
+ char buffer[102400];
+ long len = -1;
+ long count = 0;
+ int fd = open("/etc/file.temp", O_CREAT | O_WRONLY | O_TRUNC, 0666);
+ if(fd < 0) {
+ printf("Open file error:%d\n", errno);
+ return -1;
+ }
+
+ while((len = write(fd, buffer, sizeof(buffer))) > 0){
+ count += len;
+ printf("write : %ld\n", count);
+ //usleep(1000);
+ }
+
+ printf("Write complete,len = %ld, errno = %d\n", len, errno);
+
+ close(fd);
+#else
+ // 100K
+ int buffer = 1;
+ long len = -1;
+ long count = 0;
+
+ FILE *file = fopen("/etc/file.temp", "w");
+ if(file == NULL) {
+ printf("Open file error:%d\n", errno);
+ return -1;
+ }
+
+ while((len = fwrite(&buffer, sizeof(int), 1,file)) > 0){
+ buffer++;
+
+ // printf("write : %d\n", buffer);
+ //usleep(1000);
+ }
+
+ printf("Write complete,len = %d, errno = %d\n", len, errno);
+
+ fclose(file);
+#endif
+ return 0;
+}
+