+int BeatsTest(void)
+{
+ int h;
+ char b[2000];
+ int freeSpace;
+ int fsize;
+ yaffs_StartUp();
+ yaffs_mount("/ram");
+
+ h = yaffs_open("/ram/f1", O_CREAT | O_TRUNC | O_RDWR, S_IREAD | S_IWRITE);
+
+ freeSpace = yaffs_freespace("/ram");
+ printf("start free space %d\n",freeSpace);
+
+ while(yaffs_write(h,b,600) > 0) {
+ fsize = yaffs_lseek(h,0,SEEK_CUR);
+ freeSpace = yaffs_freespace("/ram");
+ printf(" %d = %d + %d\n",fsize + freeSpace,fsize,freeSpace);
+ }
+ yaffs_close(h);
+
+ freeSpace = yaffs_freespace("/ram");
+
+ return 1;
+
+}
+