* ::wimlib_progress_info.extract. */
WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN = 0,
- /** A file or directory tree within a WIM image (not the full image) is
- * about to be extracted. @p info will point to
+ /** One or more file or directory trees within a WIM image (not the full
+ * image) is about to be extracted. @p info will point to
* ::wimlib_progress_info.extract. */
WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN,
/** Path to the root dentry within the WIM for the tree that is
* being extracted. Will be the empty string when extracting a
- * full image. */
+ * full image, or when extracting a set of paths using
+ * wimlib_extract_paths() or wimlib_extract_pathlist(). */
const wimlib_tchar *extract_root_wim_source_path;
/** Currently only used for
unit_shift = get_unit(scan->num_bytes_scanned, &unit_name);
imagex_printf(T("\r%"PRIu64" %"TS" scanned (%"PRIu64" files, "
- "%"PRIu64" directories)"),
+ "%"PRIu64" directories) "),
scan->num_bytes_scanned >> unit_shift,
unit_name,
scan->num_nondirs_scanned,
info->extract.target);
break;
case WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN:
- imagex_printf(T("Extracting "
- "\""WIMLIB_WIM_PATH_SEPARATOR_STRING"%"TS"\" from image %d (\"%"TS"\") "
- "in \"%"TS"\" to \"%"TS"\"\n"),
- info->extract.extract_root_wim_source_path,
- info->extract.image,
- info->extract.image_name,
- info->extract.wimfile_name,
- info->extract.target);
+ if (info->extract.extract_root_wim_source_path[0] != T('\0')) {
+ imagex_printf(T("Extracting "
+ "\""WIMLIB_WIM_PATH_SEPARATOR_STRING"%"TS"\" "
+ "from image %d (\"%"TS"\") "
+ "in \"%"TS"\" to \"%"TS"\"\n"),
+ info->extract.extract_root_wim_source_path,
+ info->extract.image,
+ info->extract.image_name,
+ info->extract.wimfile_name,
+ info->extract.target);
+ }
break;
case WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS:
percent_done = TO_PERCENT(info->extract.completed_bytes,
}
if (progress_func) {
- progress_func(*wim_source_path ? WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN :
- WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN,
- &ctx.progress);
+ int msg;
+ if (*wim_source_path || (extract_flags & WIMLIB_EXTRACT_FLAG_PATHMODE))
+ msg = WIMLIB_PROGRESS_MSG_EXTRACT_TREE_BEGIN;
+ else
+ msg = WIMLIB_PROGRESS_MSG_EXTRACT_IMAGE_BEGIN;
+ progress_func(msg, &ctx.progress);
}
if (!ctx.root_dentry_is_special)