]> git.ipfire.org Git - thirdparty/xz.git/commit
xz: Parse directories in recursive mode.
authorJia Tan <jiat0218@gmail.com>
Wed, 1 Nov 2023 06:47:05 +0000 (14:47 +0800)
committerJia Tan <jiat0218@gmail.com>
Mon, 29 Jan 2024 13:40:53 +0000 (21:40 +0800)
commit9ffdb5f006b622d79b1562c29669c5b515d7ca02
tree858141ad5214eb77139e4fc2c826514d0966d329
parentf8c199bcdc0534a99946cb4d15c271e8778d882c
xz: Parse directories in recursive mode.

This directory parsing method prioritizes lower memory usage and file
descriptor utilization at the cost of more complicated code and a higher
number of small allocations. This method makes no recursive calls and
instead keeps a queue of directories to parse.Only one directory file
descriptor is ever needed at one time.

The directory_iterator abstracts the implementation of the directory
parsing to allow for an easy interface for both POSIX and MSVC.

Currently the MSVC builds suffers from MAX_PATH being limited to 260 by
default. This restricts the usefulness of recursive mode on Windows. A
user can edit a registry config in Windows 10, Version 1607 and later to
remove this low path limit. Alternatively, we can prefix the absolute
path with "\\?\" to also remove the restriction. Note, this restriction
also applies to the compatibility functions so MSVC builds cannot read
or write to files with paths longer than 260 characters.
src/xz/file_io.c
src/xz/file_io.h
src/xz/main.c