Skip to content

Add comprehensive symlink support to BFC containers#6

Merged
zombocoder merged 3 commits intomainfrom
feature/support-symlink
Sep 13, 2025
Merged

Add comprehensive symlink support to BFC containers#6
zombocoder merged 3 commits intomainfrom
feature/support-symlink

Conversation

@zombocoder
Copy link
Owner

This pull request adds full support for symbolic links (symlinks) to the container format and CLI tools. The changes include the ability to add, list, extract, and display information about symlinks, as well as improvements to the test suite to verify symlink handling. The implementation ensures correct preservation of symlink targets, metadata, and compatibility with compression and encryption.

Symlink Support:

  • Added a new API function bfc_add_symlink and its implementation to allow adding symlinks to containers, storing their target and metadata (include/bfc.h, src/lib/bfc_writer.c). [1] [2]
  • Updated the cmd_create command to detect symlinks during both directory and file processing, and to add them using the new API (src/cli/cmd_create.c). [1] [2] [3] [4]

Symlink Extraction:

  • Implemented extraction logic for symlinks, ensuring they are recreated as symlinks with the correct target and timestamps (src/cli/cmd_extract.c). [1] [2]
  • Included lutimes usage to set symlink timestamps and improved error handling for existing files during extraction (src/cli/cmd_extract.c). [1] [2]

Symlink Information and Listing:

  • Updated the cmd_info and cmd_list commands to recognize and display symlinks, including type, count, and mode in summary and detailed outputs (src/cli/cmd_info.c, src/cli/cmd_list.c). [1] [2] [3] [4] [5] [6]

Testing and Build System:

  • Extended the CI workflow to thoroughly test symlink creation, listing, extraction, and compatibility with compression/encryption (.github/workflows/ci.yml).
  • Modified the Makefile to enable building tests by default (Makefile).

These changes ensure that symbolic links are first-class citizens in the container format, with robust handling across all relevant CLI commands and test coverage.

- Implemented symlink addition in the container with `bfc_add_symlink`.
- Added symlink extraction functionality in `extract_symlink`.
- Updated directory processing to handle symlinks during extraction.
- Enhanced info display to include symlink statistics.
- Modified file mode formatting to recognize symlinks.
@zombocoder zombocoder merged commit 7a8c314 into main Sep 13, 2025
9 checks passed
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.

1 participant