diff --git a/writeimg.c b/writeimg.c index a369075..7bcd467 100644 --- a/writeimg.c +++ b/writeimg.c @@ -261,8 +261,14 @@ int main(int argc, char *argv[]) { } close(fd); + wjob.total_bytes = file_stat.st_size; + assert(file_stat.st_size >= 0); + if (!wjob.verify_only) - printf("Writing %s to %s\n", wjob.filename, wjob.dev_name); + printf("Writing \"%s\" (%.1f MiB) to \"%s\"\n", + basename(wjob.filename), + BYTES_TO_MIB(wjob.total_bytes), + wjob.dev_name); if (ask_permission && !wjob.verify_only) { printf("Is this okay? (y/N): "); @@ -281,9 +287,6 @@ int main(int argc, char *argv[]) { wjob.bufsize = BLOCKSIZE; wjob.block_size = BLOCKSIZE; - wjob.total_bytes = file_stat.st_size; - assert(file_stat.st_size >= 0); - perform_write(&wjob); if (wjob.buffer)