X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2FEACCES_bug%2Fyaffs_tester.c;h=81bacf08987b9ce2c3ed0352c62bbf1ba35953a6;hp=408e8882dbac128f359cbe2d11b4f178162e9e49;hb=2d7c08f638ef0b0dce832d40a1930513e7d10ce8;hpb=ebbd60a59253d7a4078222534f4b5c2509ee9e40 diff --git a/direct/timothy_tests/EACCES_bug/yaffs_tester.c b/direct/timothy_tests/EACCES_bug/yaffs_tester.c index 408e888..81bacf0 100644 --- a/direct/timothy_tests/EACCES_bug/yaffs_tester.c +++ b/direct/timothy_tests/EACCES_bug/yaffs_tester.c @@ -203,7 +203,7 @@ void test(char*yaffs_test_dir){ append_int_to_buffer(&message_buffer,stat.st_mode,MESSAGE_LEVEL_BASIC_TASKS,PRINT); } else { - add_to_buffer(&message_buffer,"file does not exists, creating file",MESSAGE_LEVEL_BASIC_TASKS,NPRINT); + add_to_buffer(&message_buffer,"file does not exists, creating file",MESSAGE_LEVEL_BASIC_TASKS,PRINT); } output=yaffs_open(path,O_CREAT | O_TRUNC| O_RDWR, S_IREAD | S_IWRITE); @@ -266,3 +266,25 @@ void generate_random_string(char *ptr){ } +void stat_file(char *path){ + int output=0; + struct yaffs_stat stat; + if (yaffs_access(path,0)==0){ + add_to_buffer(&message_buffer,"file exists, trying to stat: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT); + add_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,PRINT); + output=yaffs_lstat(path,&stat); + yaffs_check_for_errors(output, &message_buffer,"failed to stat file","statted file"); + //stat.st_ino,(int)stat.st_size,stat.st_mode + add_to_buffer(&message_buffer,"yaffs inode: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT); + append_int_to_buffer(&message_buffer,stat.st_ino,MESSAGE_LEVEL_BASIC_TASKS,NPRINT); + append_to_buffer(&message_buffer," file size: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT); + append_int_to_buffer(&message_buffer,(int)stat.st_size,MESSAGE_LEVEL_BASIC_TASKS,NPRINT); + append_to_buffer(&message_buffer," file mode: ",MESSAGE_LEVEL_BASIC_TASKS,NPRINT); + append_int_to_buffer(&message_buffer,stat.st_mode,MESSAGE_LEVEL_BASIC_TASKS,PRINT); + } + else{ + add_to_buffer(&message_buffer,path,MESSAGE_LEVEL_BASIC_TASKS,NPRINT); + append_to_buffer(&message_buffer," does not exist,could not stat",MESSAGE_LEVEL_BASIC_TASKS,PRINT); + } +} +