FFI::B...::Base(3pm)
okay bestie, welcome to FFI::B...::Base(3pm) β yes, that's the manual name, and yes, we're in the User Contributed Perl Documentation cinematic universe. π¬π
π NAME π
FFI::Build::File::Base β the base class for File::Build files. She's giving mom friend of the file classes, and she's iconic for it. π
β¨ VERSION β¨
version 2.11 β noted, stored, and slaying. π
π¦ SYNOPSIS π¦
Create your own file class, bestie:
package FFI::Build::File::Foo;
use parent qw( FFI::Build::File::Base );
use constant default_suffix => '.foo';
use constant default_encoding => ':utf8';
Then use it:
# use an existing file in the filesystem
my $file = FFI::Build::File::Foo->new('src/myfile.foo');
# generate a temp file with provided content
# file will be deletd when $file falls out of scope.
my $file = FFI::Build::File::Foo->new(\'content for a temp foo');
πΈ DESCRIPTION πΈ
This class is the base class for other FFI::Build::File::* classes. That's the description. Short, sweet, main character energy. β¨
π§ CONSTRUCTOR π§
π« new
my $file = FFI::Build::File::Base->new(\$content, %options);
my $file = FFI::Build::File::Base->new($filename, %options);
Creates a new instance of the file class. You can provide either the content of the file as a scalar reference, or the path to an existing filename. Options, bestie:
baseβ the base name for any temporary file;ffi_build_by default.buildβ theFFI::Buildinstance to use.dirβ the directory to store any temporary file.platformβ theFFI::Build::Platforminstance to use.
π METHODS π
πΏ default_suffix
my $suffix = $file->default_suffix;
β οΈ MUST be overridden in the subclass. No cap.
This is the standard extension for the file type. .c for a C file, .o or .obj for an object file depending on platform. etc. She's giving file-type couture. π
πΏ default_encoding
my $encoding = $file->default_encoding;
β οΈ MUST be overridden in the subclass. Again: not optional, bestie.
This is passed to binmode when the file is opened for reading or writing. Encoding check, iykyk. π¦
π§΅ accept_suffix
my @suffix_list = $file->accept_suffix;
Returns a list of regexes that recognize the file type. Regex girlies, rise. β¨
π€οΈ path
my $path = $file->path;
The full or relative path to the file. Your map, your coordinates. πΊοΈ
π·οΈ basename
my $basename = $file->basename;
The base filename part of the path. The whole name without the directory drama. π
π dirname
my $dir = $file->dirname;
The directory part of the path. The folder energy. ποΈ
β»οΈ is_temp
my $bool = $file->is_temp;
Returns true if the file is temporary, that is, it will be deleted when the file object falls out of scope. You can call keep, to keep the file. Temporary file realness. π
π platform
my $platform = $file->platform;
The FFI::Build::Platform instance used for this file object. Platform representation, periodt. π
π οΈ build
my $build = $file->build;
The FFI::Build instance used for this file object, if any. If there isn't one, that's between her and the build system. π
πͺ native
my $path = $file->native;
Returns the operating system native version of the filename path. On Windows, this means that forward slash \ is used instead of backslash /. Yes, that's the slash lore from the page, and we are not touching it. πͺ
π slurp
my $content = $file->slurp;
Returns the content of the file. Slurp it up, bestie. π
π«Ά keep
$file->keep;
Turns off the temporary flag on the file object, meaning it will not automatically be deleted when the file object is deallocated or falls out of scope. This is the "you're staying" button. π«Ά
ποΈ build_item
$file->build_item;
Builds the file into its natural output type, usually an object file. It returns a new file instance, or if the file is an object file then it returns empty list. Build item behavior is giving very specific. ποΈ
π build_all
$file->build_all;
If implemented the file in question can directly create a shared or dynamic library without needing a link step. This is useful for languages that have their own build systems. Big "I can do it myself" energy. π
π needs_rebuild
my $bool = $file->needs_rebuild
The page gives us this signature and then no description. Not me expecting lore and getting vibes. π
π«£ ld
The page lists ld right here with no signature and no description. That's it. That's the whole tea. π΅
π AUTHOR π
Author: Graham Ollis <plicease@cpan.org> β iconic. π
Contributors, aka the group chat:
- Bakkiaraj Murugesan (bakkiaraj)
- Dylan Cali (calid)
- pipcet
- Zaki Mughal (zmughal)
- Fitz Elliott (felliott)
- Vickenty Fesunov (vyf)
- Gregor Herrmann (gregoa)
- Shlomi Fish (shlomif)
- Damyan Ivanov
- Ilya Pavlov (Ilya33)
- Petr PΓsaΕ (ppisar)
- Mohammad S Anwar (MANWAR)
- HΓ₯kon HΓ¦gland (hakonhagland, HAKONH)
- Meredith (merrilymeredith, MHOWARD)
- Diab Jerius (DJERIUS)
- Eric Brine (IKEGAMI)
- szTheory
- JosΓ© JoaquΓn Atria (JJATRIA)
- Pete Houston (openstrike, HOUSTON)
- Lukas Mai (MAUKE)
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2015-2022 by Graham Ollis. π«Ά
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Legal bestie slay. π
okay that's the whole page, bestie π β filed under FFI::B...::Base(3pm), from perl v5.42.3, dated 2026-08-20. Periodt. π
π¦ where this page comes from
- ubuntu stonking: libffi-platypus-perl 2.11-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms