src/mess/tools/imgtool/main.c
| r5843 | r5844 | |
| 188 | 188 | imgtool_directory *imgenum = NULL; |
| 189 | 189 | imgtool_dirent ent; |
| 190 | 190 | char buf[512]; |
| 191 | char last_modified[19]; |
| 191 | 192 | const char *path; |
| 192 | 193 | int partition_index = 0; |
| 193 | 194 | |
| r5843 | r5844 | |
| 208 | 209 | goto done; |
| 209 | 210 | |
| 210 | 211 | memset(&ent, 0, sizeof(ent)); |
| 212 | last_modified[0] = '\0'; |
| 211 | 213 | total_count = 0; |
| 212 | 214 | total_size = 0; |
| 213 | 215 | |
| 214 | | fprintf(stdout, "Contents of %s:\n", argv[1]); |
| 216 | fprintf(stdout, "Contents of %s:%s\n", argv[1], path ? path : ""); |
| 215 | 217 | |
| 216 | 218 | imgtool_image_info(image, buf, sizeof(buf)); |
| 217 | 219 | if (buf[0]) |
| 218 | 220 | fprintf(stdout, "%s\n", buf); |
| 219 | | fprintf(stdout, "------------------------ ------ ---------------\n"); |
| 221 | fprintf(stdout, "------------------------------ -------- --------------- ------------------\n"); |
| 220 | 222 | |
| 221 | 223 | while (((err = imgtool_directory_get_next(imgenum, &ent)) == 0) && !ent.eof) |
| 222 | 224 | { |
| r5843 | r5844 | |
| 225 | 227 | else |
| 226 | 228 | snprintf(buf, sizeof(buf), "%u", (unsigned int) ent.filesize); |
| 227 | 229 | |
| 228 | | fprintf(stdout, "%-20s\t%8s %15s\n", ent.filename, buf, ent.attr); |
| 230 | if (ent.lastmodified_time != 0) |
| 231 | strftime(last_modified, sizeof(last_modified), "%d-%b-%y %H:%M:%S", |
| 232 | localtime(&ent.lastmodified_time)); |
| 233 | |
| 234 | if (ent.hardlink) |
| 235 | strcat(ent.filename, " <hl>"); |
| 236 | |
| 237 | fprintf(stdout, "%-30s %8s %15s %18s\n", ent.filename, buf, ent.attr, last_modified); |
| 238 | |
| 239 | if (ent.softlink && ent.softlink[0] != '\0') |
| 240 | fprintf(stdout, "-> %s\n", ent.softlink); |
| 241 | |
| 242 | if (ent.comment && ent.comment[0] != '\0') |
| 243 | fprintf(stdout, ": %s\n", ent.comment); |
| 244 | |
| 229 | 245 | total_count++; |
| 230 | 246 | total_size += ent.filesize; |
| 247 | |
| 248 | memset(&ent, 0, sizeof(ent)); |
| 231 | 249 | } |
| 232 | 250 | |
| 233 | 251 | freespace_err = imgtool_partition_get_free_space(partition, &freespace); |