ctx->num_streams_remaining++;
}
- if (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_SEQUENTIAL) {
+ if (!(ctx->extract_flags & WIMLIB_EXTRACT_FLAG_FILE_ORDER)) {
struct wim_dentry **lte_dentries;
/* Append dentry to this stream's array of dentries referencing
* This function operates slightly differently depending on whether @lte_spec is
* NULL or not. When @lte_spec is NULL, the behavior is to extract the default
* file contents (unnamed stream), and, if named data streams are supported in
- * the extract mode and volume, any named data streams. When @lte_spec is NULL,
- * the behavior is to extract only all copies of the stream @lte_spec, and in
- * addition use @lte_spec to set the reparse data or create the symbolic link if
- * appropriate.
+ * the extract mode and volume, any named data streams. When @lte_spec is not
+ * NULL, the behavior is to extract only all copies of the stream @lte_spec, and
+ * in addition use @lte_spec to set the reparse data or create the symbolic link
+ * if appropriate.
*
* @path
* Path to file to extract (as can be passed to apply_operations
return 0;
}
-/* Create a file or directory, then immediately extract all streams. This
- * assumes that WIMLIB_EXTRACT_FLAG_SEQUENTIAL is not specified, since the WIM
+/* Create a file or directory, then immediately extract all streams. The WIM
* may not be read sequentially by this function. */
static int
dentry_extract(struct wim_dentry *dentry, void *_ctx)
static int
extract_stream_list(struct apply_ctx *ctx)
{
- if (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_SEQUENTIAL) {
+ if (!(ctx->extract_flags & WIMLIB_EXTRACT_FLAG_FILE_ORDER)) {
/* Sequential extraction: read the streams in the order in which
* they appear in the WIM file. */
struct read_stream_list_callbacks cbs = {
return 0;
}
- if (buf.stream_hdr.magic != PWM_STREAM_MAGIC) {
+ if (le64_to_cpu(buf.stream_hdr.magic) != PWM_STREAM_MAGIC) {
ERROR("Data read on pipe is invalid (expected stream header).");
return WIMLIB_ERR_INVALID_PIPABLE_WIM;
}
&& (needed_lte = lookup_resource(lookup_table, found_lte->hash))
&& (needed_lte->out_refcnt))
{
- char *tmpfile_name = NULL;
+ tchar *tmpfile_name = NULL;
struct wim_lookup_table_entry *lte_override;
struct wim_lookup_table_entry tmpfile_lte;
}
/* Finally, the important part: extract the tree of files. */
- if (extract_flags & (WIMLIB_EXTRACT_FLAG_SEQUENTIAL |
- WIMLIB_EXTRACT_FLAG_FROM_PIPE)) {
+ if (!(extract_flags & WIMLIB_EXTRACT_FLAG_FILE_ORDER)) {
/* Sequential extraction requested, so two passes are needed
* (one for directory structure, one for streams.) */
if (progress_func)
out_teardown_stream_list:
/* Free memory allocated as part of the mapping from each
* wim_lookup_table_entry to the dentries that reference it. */
- if (ctx.extract_flags & WIMLIB_EXTRACT_FLAG_SEQUENTIAL)
+ if (!(ctx.extract_flags & WIMLIB_EXTRACT_FLAG_FILE_ORDER))
list_for_each_entry(lte, &ctx.stream_list, extraction_list)
if (lte->out_refcnt > ARRAY_LEN(lte->inline_lte_dentries))
FREE(lte->lte_dentries);
* corresponding file or symbolic link data. This needs to be handled
* better. */
if ((extract_flags & (WIMLIB_EXTRACT_FLAG_UNIX_DATA |
- WIMLIB_EXTRACT_FLAG_SEQUENTIAL))
- == (WIMLIB_EXTRACT_FLAG_UNIX_DATA |
- WIMLIB_EXTRACT_FLAG_SEQUENTIAL))
+ WIMLIB_EXTRACT_FLAG_FILE_ORDER))
+ == WIMLIB_EXTRACT_FLAG_UNIX_DATA)
{
if (extract_flags & WIMLIB_EXTRACT_FLAG_FROM_PIPE) {
WARNING("Setting UNIX file/owner group may "
" symbolic links "
"when applying from a pipe.");
} else {
- extract_flags &= ~WIMLIB_EXTRACT_FLAG_SEQUENTIAL;
+ extract_flags |= WIMLIB_EXTRACT_FLAG_FILE_ORDER;
WARNING("Disabling sequential extraction for "
"UNIX data mode");
}
if (extract_flags & WIMLIB_EXTRACT_FLAG_TO_STDOUT)
return WIMLIB_ERR_INVALID_PARAM;
- extract_flags |= WIMLIB_EXTRACT_FLAG_SEQUENTIAL;
-
/* Read the WIM header from the pipe and get a WIMStruct to represent
* the pipable WIM. Caveats: Unlike getting a WIMStruct with
* wimlib_open_wim(), getting a WIMStruct in this way will result in