logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

FFI::C::PosixFile - Perl interface to C File pointer with POSIX extensions

Author

       Graham Ollis <plicease@cpan.org>

Constructor

fopen
        my $file = FFI::C::PosixFile->fopen($filename, $mode);

       Opens the file with the given mode.  See your standard library C documentation for the exact format of
       $mode.

   new
        my $file = FFI::C::PosixFile->new($ptr);

       Create a new File instance object from the opaque pointer.  Note that it isn't possible to do any error
       checking on the type, so make sure that the pointer you are providing really is a C file pointer.

   fdopen
        my $file = FFI::C::PosixFile->fdopen($fd, $mode);

       Create a new File instance from a POSIX file descriptor.

Description

       This is a subclass of FFI::C::File which adds a couple of useful POSIX extensions that may not be
       available on non-POSIX systems.  Trying to create an instance of this class will fail on platforms that
       do not support the extensions.

Methods

fileno
        my $fd = $file->fileno;

       Returns the POSIX file descriptor for the file pointer.

Name

       FFI::C::PosixFile - Perl interface to C File pointer with POSIX extensions

See Also

       FFI::C
       FFI::C::Array
       FFI::C::ArrayDef
       FFI::C::Def
       FFI::C::File
       FFI::C::PosixFile
       FFI::C::Struct
       FFI::C::StructDef
       FFI::C::Union
       FFI::C::UnionDef
       FFI::C::Util
       FFI::Platypus::Record

Synopsis

        use FFI::C::PosixFile;

        my $stdout = FFI::C::PosixFile->fdopen(1, "w");
        say $stdout->fileno;  # prints 1

Version

       version 0.15

See Also