yaffs_stat(str,&s);
- printf("%s length %d mode %X ",de->d_name,s.st_size,s.st_mode);
- switch(s.st_mode & S_IFMT)
+ printf("%s length %d mode %X ",de->d_name,s.yst_size,s.yst_mode);
+ switch(s.yst_mode & S_IFMT)
{
case S_IFREG: printf("data file"); break;
case S_IFDIR: printf("directory"); break;
yaffs_lstat(str,&s);
- printf("%s length %d mode %X ",de->d_name,s.st_size,s.st_mode);
- switch(s.st_mode & S_IFMT)
+ printf("%s length %d mode %X ",de->d_name,s.yst_size,s.yst_mode);
+ switch(s.yst_mode & S_IFMT)
{
case S_IFREG: printf("data file"); break;
case S_IFDIR: printf("directory"); break;
// Check chmod
yaffs_stat("/boot/yyfile",&ystat);
- temp_mode = ystat.st_mode;
+ temp_mode = ystat.yst_mode;
yaffs_chmod("/boot/yyfile",0x55555);
printf("\nDirectory look-up of /boot\n");
}
+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;
+
+}
+
int main(int argc, char *argv[])
{
//return long_test(argc,argv);
//return cache_bypass_bug_test();
- return free_space_check();
+ // return free_space_check();
+
+ return BeatsTest();
}