+int cmd_yaffs_check(const char *fname, const char *type)
+{
+ int retval = 0;
+ int ret;
+ struct yaffs_stat stat;
+
+ ret = yaffs_stat(fname, &stat);
+ if (ret < 0) {
+ printf("%s not found\n", fname);
+ return -1;
+ }
+
+ printf("%s is a %s\n", fname, yaffs_file_type_str(&stat));
+
+ if (strcmp(type, "REG") == 0 &&
+ (stat.st_mode & S_IFMT) != S_IFREG)
+ retval = -1;