Skip to content

Implement file.decompress#1000

Merged
jabbate19 merged 5 commits intomainfrom
65_implement_file_decompress
Nov 10, 2025
Merged

Implement file.decompress#1000
jabbate19 merged 5 commits intomainfrom
65_implement_file_decompress

Conversation

@jabbate19
Copy link
Copy Markdown
Collaborator

What type of PR is this?

/kind documentation
/kind feature
/kind eldritch-function

What this PR does / why we need it:

Implements a decompression method for files and directories. Uses gzip, then tar if applicable for directories. Includes tests and documentation.

Unit Test Results
skyz@DESKTOP-M0SBB8Q:~/realm/implants/lib/eldritch$ cargo test --package eldritch --lib -- file::decompress_impl::tests --nocapture
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.23s
     Running unittests src/lib.rs (/home/skyz/realm/implants/target/debug/deps/eldritch-2f3839402acc0ece)

running 2 tests
Decompressed single file to /tmp/.tmpKhbV7G_decompressed
test file::decompress_impl::tests::test_decompress_basic ... ok
Decompressed tar archive to dir /tmp/.tmpPCigR5_decompressed
test file::decompress_impl::tests::test_decompress_tar_dir ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 190 filtered out; finished in 0.00s
Implementation Demo

File

skyz@DESKTOP-M0SBB8Q:~/realm/implants$ cargo run --bin=golem -- -i
$> file.compress("/tmp/test_content/foo.txt", "/tmp/foo.txt.gz")
$> file.decompress("/tmp/foo.txt.gz", "/tmp/foo.txt.out")
skyz@DESKTOP-M0SBB8Q:/tmp/test_content$ shasum /tmp/test_content/foo.txt 
f1d2d2f924e986ac86fdf7b36c94bcdf32beec15  /tmp/test_content/foo.txt
skyz@DESKTOP-M0SBB8Q:/tmp/test_content$ shasum /tmp/foo.txt.out
f1d2d2f924e986ac86fdf7b36c94bcdf32beec15  /tmp/foo.txt.out

Directory

skyz@DESKTOP-M0SBB8Q:~/realm/implants$ cargo run --bin=golem -- -i
$> file.compress("/tmp/test_content", "/tmp/test_content.tar.gz")
$> file.decompress("/tmp/test_content.tar.gz", "/tmp/test_content_output")
skyz@DESKTOP-M0SBB8Q:/tmp$ shasum /tmp/test_content/*
e242ed3bffccdf271b7fbaf34ed72d089537b42f  /tmp/test_content/bar.txt
f1d2d2f924e986ac86fdf7b36c94bcdf32beec15  /tmp/test_content/foo.txt
skyz@DESKTOP-M0SBB8Q:/tmp$ shasum /tmp/test_content_output/test_content/*
e242ed3bffccdf271b7fbaf34ed72d089537b42f  /tmp/test_content_output/test_content/bar.txt
f1d2d2f924e986ac86fdf7b36c94bcdf32beec15  /tmp/test_content_output/test_content/foo.txt

Which issue(s) this PR fixes:

Fixes #65

Resolves #65

Implements a decompression method for files and directories. Uses gzip, then tar if applicable for directories.
Includes tests and documentation.
@jabbate19 jabbate19 force-pushed the 65_implement_file_decompress branch from ec340e9 to 67a2094 Compare November 9, 2025 17:09
hulto
hulto previously approved these changes Nov 9, 2025
@jabbate19 jabbate19 merged commit 8cb7bf6 into main Nov 10, 2025
4 of 8 checks passed
@jabbate19 jabbate19 deleted the 65_implement_file_decompress branch November 10, 2025 03:49
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.

Implement file.decompress

2 participants