Alien-PhysFS

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

    No write directory has been specified.

- `ERR_OPEN_FOR_READING`

    Wrote to a file opened for reading.

- `ERR_OPEN_FOR_WRITING`

    Read from a file opened for writing.

- `ERR_NOT_A_FILE`

    Needed a file, got a directory, etc.

- `ERR_READ_ONLY`

    Wrote to a read-only filesystem.

- `ERR_CORRUPT`

    Corrupted data encountered.

- `ERR_SYMLINK_LOOP`

    Infinite symbolic link loop.

- `ERR_IO`

    I/O error (hardware failure, etc).

- `ERR_PERMISSION`

    Permission denied.

- `ERR_NO_SPACE`

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

- `ERR_BAD_FILENAME`

    Filename is bogus or insecure.

- `ERR_BUSY`

    Tried to modify a file the OS needs.

- `ERR_DIR_NOT_EMPTY`

    Tried to delete a directory with files in it.

- `ERR_OS_ERROR`

    Unspecified OS-level error.

- `ERR_DUPLICATE`

    Duplicate entry.

- `ERR_BAD_PASSWORD`

    Bad password.

- `ERR_APP_CALLBACK`

    Application callback reported an error.

#### `getLastErrorCode( )`

Return the current thread's last error as an `ErrorCode` value. Returns `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 `getErrorByCode( )`. Safe before `init( )`.

#### `getErrorByCode( $code )`

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

#### `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.

#### `GetError( )`

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

### `:mount` - Mounting archives and directories

#### `mount( $newDir, $mountPoint, $appendToPath )`

Add a directory or archive to the search path. `$newDir` is a platform-dependent path. `$mountPoint` is a
platform-independent virtual location; `undef` or `''` means `/`. `$appendToPath` appends rather than prepends.
Returns non-zero on success.

Mount points need not already exist. Multiple archives may be mounted at the same point; their files are interpolated
into one tree and earlier search-path entries win when names overlap. This makes archives useful for overrides and
mods. Duplicate mounts of the same archive are ignored, even if a different mount point is requested. A symlink in
`$newDir` is allowed regardless of `permitSymbolicLinks( )`.

#### `unmount( $oldDir )`

Remove a directory or archive from the search path. `$oldDir` must be the exact platform-dependent string passed to
`mount( )`, not the virtual mount point. Matching is case-sensitive. This fails if any files from that entry are still
open. Returns non-zero on success.

#### `getMountPoint($dir)`

Return the virtual mount point for a previously mounted platform-dependent path, or `undef` on failure. The returned
string is read-only and valid until the entry is unmounted. Entries mounted with a null mount point report `/`.

### `:files` - File access

File handles are opaque objects returned by `openRead`, `openWrite`, or `openAppend`. Pass them unmodified to the
other functions in this tag. The `_File` typedef is exported as the handle type.

Remember that `close`, `delete`, `exists`, `mkdir`, `seek`, and `stat` shadow Perl builtins; see ["Functions
that shadow Perl builtins"](#functions-that-shadow-perl-builtins).

#### `mkdir( $dirName )`



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