* */
const wimlib_tchar *cur_path;
- /** True iff @p cur_path is being excluded from the image
- * capture due to the capture configuration file. */
- bool excluded;
+ enum {
+ /** File or directory looks okay and will be captured. */
+ WIMLIB_SCAN_DENTRY_OK = 0,
+
+ /** File or directory is being excluded from capture due
+ * to the capture configuration file. */
+ WIMLIB_SCAN_DENTRY_EXCLUDED,
+
+ /** File or directory is being excluded from capture due
+ * to being unsupported (e.g. an encrypted or device
+ * file). */
+ WIMLIB_SCAN_DENTRY_UNSUPPORTED,
+ } status;
/** Target path in the WIM. Only valid on messages
* ::WIMLIB_PROGRESS_MSG_SCAN_BEGIN and
WIMLIB_ERR_SET_SECURITY,
WIMLIB_ERR_SET_SHORT_NAME,
WIMLIB_ERR_SET_TIMESTAMPS,
- WIMLIB_ERR_SPECIAL_FILE,
WIMLIB_ERR_SPLIT_INVALID,
WIMLIB_ERR_SPLIT_UNSUPPORTED,
WIMLIB_ERR_STAT,
}
break;
case WIMLIB_PROGRESS_MSG_SCAN_DENTRY:
- if (info->scan.excluded)
- imagex_printf(T("Excluding \"%"TS"\" from capture\n"), info->scan.cur_path);
- else
+ switch (info->scan.status) {
+ case WIMLIB_SCAN_DENTRY_OK:
imagex_printf(T("Scanning \"%"TS"\"\n"), info->scan.cur_path);
+ break;
+ case WIMLIB_SCAN_DENTRY_EXCLUDED:
+ imagex_printf(T("Excluding \"%"TS"\" from capture\n"), info->scan.cur_path);
+ break;
+ case WIMLIB_SCAN_DENTRY_UNSUPPORTED:
+ imagex_printf(T("WARNING: Excluding unsupported file or directory\n"
+ " \"%"TS"\" from capture\n"), info->scan.cur_path);
+ break;
+ }
break;
case WIMLIB_PROGRESS_MSG_VERIFY_INTEGRITY:
unit_shift = get_unit(info->integrity.total_bytes, &unit_name);
{
union wimlib_progress_info info;
info.scan.cur_path = path;
- info.scan.excluded = true;
+ info.scan.status = WIMLIB_SCAN_DENTRY_EXCLUDED;
params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY, &info);
}
root = NULL;
return WIMLIB_ERR_NTFS_3G;
}
+ if ((attributes & (FILE_ATTRIBUTE_DIRECTORY |
+ FILE_ATTRIBUTE_ENCRYPTED)) == FILE_ATTRIBUTE_ENCRYPTED)
+ {
+ if ((params->add_flags & WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE)
+ && params->progress_func)
+ {
+ union wimlib_progress_info info;
+ info.scan.cur_path = path;
+ info.scan.status = WIMLIB_SCAN_DENTRY_UNSUPPORTED;
+ params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY, &info);
+ }
+ root = NULL;
+ ret = 0;
+ goto out;
+ }
+
if ((params->add_flags & WIMLIB_ADD_FLAG_VERBOSE)
&& params->progress_func)
{
union wimlib_progress_info info;
info.scan.cur_path = path;
- info.scan.excluded = false;
+ info.scan.status = WIMLIB_SCAN_DENTRY_OK;
params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY, &info);
}
{
union wimlib_progress_info info;
info.scan.cur_path = path;
- info.scan.excluded = true;
+ info.scan.status = WIMLIB_SCAN_DENTRY_EXCLUDED;
params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY, &info);
}
goto out;
{
union wimlib_progress_info info;
info.scan.cur_path = path;
- info.scan.excluded = false;
+ info.scan.status = WIMLIB_SCAN_DENTRY_OK;
params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY, &info);
}
}
if (!S_ISREG(stbuf.st_mode) && !S_ISDIR(stbuf.st_mode)
&& !S_ISLNK(stbuf.st_mode)) {
- ERROR("`%s' is not a regular file, directory, or symbolic link.",
- path);
- ret = WIMLIB_ERR_SPECIAL_FILE;
+ if ((params->add_flags & WIMLIB_ADD_FLAG_EXCLUDE_VERBOSE)
+ && params->progress_func)
+ {
+ union wimlib_progress_info info;
+ info.scan.cur_path = path;
+ info.scan.status = WIMLIB_SCAN_DENTRY_UNSUPPORTED;
+ params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY, &info);
+ }
goto out;
}
= T("Failed to set short name on extracted file"),
[WIMLIB_ERR_SET_TIMESTAMPS]
= T("Failed to set timestamps on extracted file"),
- [WIMLIB_ERR_SPECIAL_FILE]
- = T("Encountered a special file that cannot be archived"),
[WIMLIB_ERR_SPLIT_INVALID]
= T("The WIM is part of an invalid split WIM"),
[WIMLIB_ERR_SPLIT_UNSUPPORTED]
{
union wimlib_progress_info info;
info.scan.cur_path = path;
- info.scan.excluded = true;
+ info.scan.status = WIMLIB_SCAN_DENTRY_EXCLUDED;
params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY, &info);
}
ret = 0;
{
union wimlib_progress_info info;
info.scan.cur_path = path;
- info.scan.excluded = false;
+ info.scan.status = WIMLIB_SCAN_DENTRY_OK;
params->progress_func(WIMLIB_PROGRESS_MSG_SCAN_DENTRY, &info);
}