Alien-PhysFS

 view release on metacpan or  search on metacpan

lib/Game/PhysicsFS.pm  view on Meta::CPAN

No write directory has been specified.

=item C<ERR_OPEN_FOR_READING>

Wrote to a file opened for reading.

=item C<ERR_OPEN_FOR_WRITING>

Read from a file opened for writing.

=item C<ERR_NOT_A_FILE>

Needed a file, got a directory, etc.

=item C<ERR_READ_ONLY>

Wrote to a read-only filesystem.

=item C<ERR_CORRUPT>

Corrupted data encountered.

=item C<ERR_SYMLINK_LOOP>

Infinite symbolic link loop.

=item C<ERR_IO>

I/O error (hardware failure, etc).

=item C<ERR_PERMISSION>

Permission denied.

=item C<ERR_NO_SPACE>

No space (disk full, over quota, etc).

=item C<ERR_BAD_FILENAME>

Filename is bogus or insecure.

=item C<ERR_BUSY>

Tried to modify a file the OS needs.

=item C<ERR_DIR_NOT_EMPTY>

Tried to delete a directory with files in it.

=item C<ERR_OS_ERROR>

Unspecified OS-level error.

=item C<ERR_DUPLICATE>

Duplicate entry.

=item C<ERR_BAD_PASSWORD>

Bad password.

=item C<ERR_APP_CALLBACK>

Application callback reported an error.

=back

=head4 C<getLastErrorCode( )>

Return the current thread's last error as an C<ErrorCode> value. Returns C<ERR_OK> if no error has been recorded since
the last read. Calling this function clears the thread's error state, as does reading the deprecated text error. If you
need both the code and its message, read the code and pass it to C<getErrorByCode( )>. Safe before C<init( )>.

=head4 C<getErrorByCode( $code )>

Return a read-only, static English description for an error code, or C<undef> if the code is unknown. The strings are
stable and suitable as keys for your own localization. Safe before C<init( )>.

=head4 C<setErrorCode( $code )>

Set the current thread's error code. This is mainly useful inside custom I/O callbacks. Any subsequent PhysicsFS call
may overwrite it, so it is not a general-purpose error-reporting mechanism.

=head4 C<GetError( )>

Perl helper that reads the current thread's error code, converts it with C<getErrorByCode( )>, and returns the string
(or C<Unknown PhysicsFS error> if the code has no description). Like C<getLastErrorCode( )>, this consumes the error
state.

=cut

    sub _error () {
        state $done++ && return;
        _enum_and_export ErrorCode => [
            qw[
                ERR_OK ERR_OTHER_ERROR ERR_OUT_OF_MEMORY
                ERR_NOT_INITIALIZED ERR_IS_INITIALIZED
                ERR_ARGV0_IS_NULL ERR_UNSUPPORTED ERR_PAST_EOF
                ERR_FILES_STILL_OPEN ERR_INVALID_ARGUMENT
                ERR_NOT_MOUNTED ERR_NOT_FOUND ERR_SYMLINK_FORBIDDEN
                ERR_NO_WRITE_DIR ERR_OPEN_FOR_READING
                ERR_OPEN_FOR_WRITING ERR_NOT_A_FILE ERR_READ_ONLY
                ERR_CORRUPT ERR_SYMLINK_LOOP ERR_IO
                ERR_PERMISSION ERR_NO_SPACE ERR_BAD_FILENAME
                ERR_BUSY ERR_DIR_NOT_EMPTY ERR_OS_ERROR
                ERR_DUPLICATE ERR_BAD_PASSWORD ERR_APP_CALLBACK
            ]
        ];
        _affix_and_export getLastErrorCode => [], ErrorCode();
        _affix_and_export getErrorByCode   => [ ErrorCode() ], String;
        _affix_and_export setErrorCode     => [ ErrorCode() ], Void;
        _func_and_export GetError => sub () {
            my $code = 0 + getLastErrorCode();
            return getErrorByCode($code) // 'Unknown PhysicsFS error';
        };
    }

=head3 C<:mount> - Mounting archives and directories

=head4 C<mount( $newDir, $mountPoint, $appendToPath )>



( run in 0.855 second using v1.01-cache-2.11-cpan-f5f21f1076c )