Changeset 660
- Timestamp:
- Jul 24, 2015, 3:10:49 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/shell/main.c
r655 r660 48 48 static void cmd_ls(int argc, char** argv) 49 49 { 50 if (argc < 2) 51 { 52 giet_tty_printf("%s <path>\n", argv[0]); 53 return; 54 } 55 56 giet_fat_list(argv[1]); 50 int fd; 51 fat_dirent_t entry; 52 53 if (argc < 2) 54 fd = giet_fat_opendir("/"); 55 else 56 fd = giet_fat_opendir(argv[1]); 57 58 if (fd < 0) 59 { 60 giet_tty_printf("can't list directory (err=%d)\n", fd); 61 return; 62 } 63 64 while (giet_fat_readdir(fd, &entry) == 0) 65 { 66 if (entry.is_dir) 67 giet_tty_printf("dir "); 68 else 69 giet_tty_printf("file"); 70 71 giet_tty_printf(" | size = %d \t| cluster = %X \t| %s\n", 72 entry.size, entry.cluster, entry.name ); 73 } 74 75 giet_fat_closedir(fd); 57 76 } 58 77 … … 85 104 int src_fd = -1; 86 105 int dst_fd = -1; 87 struct fat_file_info_sinfo;106 fat_file_info_t info; 88 107 int size; 89 108 int i;
Note: See TracChangeset
for help on using the changeset viewer.