Parcourir la source

add some print in tell_seek_dir_sample

yangjie il y a 7 ans
Parent
commit
14e26bd892
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      tell_seek_dir_sample.c

+ 5 - 0
tell_seek_dir_sample.c

@@ -28,7 +28,9 @@ static void telldir_sample(void)
     struct dirent *dp;
 
     /* 打开根目录 */
+    rt_kprintf("the directory is:\n");
     dirp = opendir("/");
+    
     for (dp = readdir(dirp); dp != RT_NULL; dp = readdir(dirp))
     {
         /* 保存第三个目录项的目录指针*/
@@ -50,8 +52,11 @@ static void telldir_sample(void)
     }
 
     /* 从第三个目录项开始打印*/
+    rt_kprintf("\nthe result of tell_seek_dir is:\n");
     for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
+    {
         rt_kprintf("%s\n", dp->d_name);
+    }
 
     /* 关闭目录*/
     closedir(dirp);