Logo

dev-resources.site

for different kinds of informations.

Create foo.a using Pure Perl and Archive::Ar

Published at
12/20/2021
Categories
perl
c
cpp
cpan
Author
yukikimoto
Categories
4 categories in total
perl
open
c
open
cpp
open
cpan
open
Author
10 person written this
yukikimoto
open
Create foo.a using Pure Perl and Archive::Ar

I'm searching for the way to create static library such as "foo.a".

I found Archive::Ar on CPAN.

use Archive::Ar;

my $ar = Archive::Ar->new;

$ar->read('./foo.ar');
$ar->extract;

$ar->add_files('./bar.tar.gz', 'bat.pl')
$ar->add_data('newfile.txt','Some contents');

$ar->chmod('file1', 0644);
$ar->chown('file1', $uid, $gid);

$ar->remove('file1', 'file2');

my $filehash = $ar->get_content('bar.tar.gz');
my $data = $ar->get_data('bar.tar.gz');
my $handle = $ar->get_handle('bar.tar.gz');

my @files = $ar->list_files();

my $archive = $ar->write;
my $size = $ar->write('outbound.ar');

$ar->error();
Enter fullscreen mode Exit fullscreen mode

I'm working to create SPVM.

SPVM has C/C++ binding tools.

cpan Article's
30 articles in total
Favicon
A link site of your very own
Favicon
App::cpx
Favicon
Combining calendars
Favicon
Installing CPAN modules from git
Favicon
Deploying Dancer Apps
Favicon
Feature release 1.36 of the Date::Holidays Perl distribution
Favicon
Building a tool to integrate Readwise.io highlights into my Zettelkasten via Perl
Favicon
Dist::Zilla::Plugin::GitHub::CreateRelease
Favicon
GitHub Organisations
Favicon
Mission (Almost) Accomplished
Favicon
Writing a CPAN module that talks to ChatGPT
Favicon
How to download cpanm in the portable way that supports Perl 5.8.1
Favicon
SPVM::IO 0.14 is released on Perl/CPAN
Favicon
Feature release 1.32 of Date::Holidays Perl distribution
Favicon
CPAN Module Tutorials
Favicon
cpanm - Installation of Perl Modules on User Directories 2022
Favicon
Wrapping a JSON API to access your personal data
Favicon
Highlighting members of the Perl family
Favicon
Create foo.a using Pure Perl and Archive::Ar
Favicon
Multiple ways to inheritance in Perl
Favicon
Taming the Moose: Classing up Perl attributes
Favicon
Some thoughts on Perl template processing
Favicon
Making Single-binary Release with pp
Favicon
The reports of Perl’s death have been greatly exaggerated
Favicon
Read The Fantastic Manual: How to get the most out of Perl documentation
Favicon
Failing to get product information from Amazon with Perl
Favicon
CPAN Release of TooMuchCode 0.18
Favicon
Fast Perl module installation with cpm
Favicon
CPAN installation as a test, with GitHub workflow
Favicon
CPAN Release of TooMuchCode 0.17

Featured ones: