Skip to content

pffexport: export folders with more than 100000 items - #1

Draft
Mizaro wants to merge 2 commits into
masterfrom
cursor/pffexport-large-folders-e5d1
Draft

Mizaro wants to merge 2 commits into
masterfrom
cursor/pffexport-large-folders-e5d1

Conversation

@Mizaro

@Mizaro Mizaro commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

Fixes the pffexport 5-digit item directory cap tracked upstream as libyal/libpff#71.

export_handle_create_default_item_directory used %05d and then treated any extra digit as an error, so item 100000 failed instead of becoming Message100001. Five-digit zero padding is unchanged for indexes 1–99999.

Tests follow the existing libyal layout:

  • export_handle_initialize / export_handle_free (regular and error cases)
  • export_handle_create_default_item_directory for item_index == 100000, plus NULL/negative-index errors
  • pfftools_output_copyright_fprint, pfftools_output_version_fprint, and pfftools_output_version_detailed_fprint (invocation plus NULL stream)

The earlier Cygwin coverage failure was #include <direct.h> when --enable-winapi is set. Cleanup now uses RemoveDirectory on WINAPI and rmdir otherwise.

How to verify

./synclibs.sh
./autogen.sh
./configure --disable-nls
make
make -C tests pff_test_tools_export_handle pff_test_tools_output
./tests/pff_test_tools_export_handle
./tests/pff_test_tools_output
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 20, 2026 03:42
pffexport rejected and truncated numbered item paths at five digits, so a folder with more than 100000 items could not be exported. Keep five-digit zero padding for smaller indexes and let sprintf grow the name for larger ones.

Add an export_handle test that requires Message100001 for item index 100000.

Co-authored-by: Gilad Leifman <Mizaro@users.noreply.github.com>
Co-authored-by: Gilad Leifman <Mizaro@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants