Filesys-POSIX

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

        `$fs->rmdir()` must be used instead for removing directory inodes.

    Upon success, a reference to the inode removed from its parent directory will
    be returned.

- `$fs->rename($old, $new)`

    Relocate the item specified by the `$old` argument to the new path specified by
    $new.

    Using `$fs->lstat`, the inode for the old pathname is resolved;
    `$fs->stat` is then used to resolve the path of the parent directory of
    the argument specified in `$new`.

    If an inode exists at the path specified by `$new`, it will be replaced by
    `$old` in the following circumstances:

    - Both the source `$old` and destination `$new` are non-directory inodes.
    - Both the source `$old` and destination `$new` are directory inodes, and
    the destination is empty.

    The following exceptions are thrown for error conditions:

    - EPERM (Operation not permitted)

        Currently, `$fs->rename()` cannot operate if the inode at the old location
        is an inode associated with a Filesys::POSIX::Real filesystem type.

    - EXDEV (Cross-device link)

        The inode at the old path does not exist on the same filesystem device as the
        inode of the parent directory specified in the new path.

    - ENOTDIR (Not a directory)

        The old inode is a directory, but an existing inode found in the new path
        specified, is not.

    - EISDIR (Is a directory)

        The old inode is not a directory, but an existing inode found in the new path
        specified, is.

    - ENOTEMPTY (Directory not empty)

        Both the old and new paths correspond to a directory, but the new path is not
        of an empty directory.

    Upon success, a reference to the inode to be renamed will be returned.

- `$fs->rmdir($path)`

    Unlinks the directory inode at the specified path.  Exceptions are thrown in
    the following conditions:

    - ENOENT (No such file or directory)

        No inode exists by the name specified in the final component of the path in
        the parent directory specified in the path.

    - EBUSY (Device or resource busy)

        The directory specified is an active mount point.

    - ENOTDIR (Not a directory)

        The inode found at `$path` is not a directory.

    - ENOTEMPTY (Directory not empty)

        The directory is not empty.

    Upon success, a reference to the inode of the directory to be removed will be
    returned.

- `$fs->mknod($path, $mode)`
- `$fs->mknod($path, $mode, $dev)`

    Create a new inode at the specified `$path`, with the inode permissions and
    format specified in the `$mode` argument.  If `$mode` specifies a `$S_IFCHR`
    or `$S_IFBLK` value, then the device number specified in `$dev` will be given
    to the new inode.

    Code contained within the `Filesys::POSIX` distribution assumes that the device
    identifier shall contain the major and minor numbers in separate 16-bit fields,
    in the following manner:

        my $major = ($dev & 0xffff0000) >> 16;
        my $minor =  $dev & 0x0000ffff;

    Returns a reference to a [Filesys::POSIX::Inode](https://metacpan.org/pod/Filesys::POSIX::Inode) object upon success.

- `$fs->mkfifo($path, $mode)`

    Create a new FIFO device at the specified `$path`, with the permissions listed
    in `$mode`.  Internally, this function is a frontend to
    `Filesys::POSIX->mknod`.

    Returns a reference to a [Filesys::POSIX::Inode](https://metacpan.org/pod/Filesys::POSIX::Inode) object upon success.

# EXTENSION MODULES

- [Filesys::POSIX::Extensions](https://metacpan.org/pod/Filesys::POSIX::Extensions)

    This module provides a variety of functions for performing inode operations in
    novel ways that take advantage of the unique characteristics and features of
    Filesys::POSIX.  For example, one method is provided that allows a developer to
    map a file or directory from the system's underlying, actual filesystem, into
    any arbitrary point in the virtual filesystem.

- [Filesys::POSIX::Userland::Find](https://metacpan.org/pod/Filesys::POSIX::Userland::Find)

    Provides the ability to perform breadth-first operations on file hierarchies
    within an instance of a `Filesys::POSIX` filesystem, in a subset of the
    functionality provided in [File::Find](https://metacpan.org/pod/File::Find).

- [Filesys::POSIX::Userland::Tar](https://metacpan.org/pod/Filesys::POSIX::Userland::Tar)

    Provides an implementation of the POSIX ustar and certain aspects of the GNU tar
    standard.  Currently allows for the creation of tar archives based on
    hierarchies within a `Filesys::POSIX` instance.



( run in 1.445 second using v1.01-cache-2.11-cpan-39bf76dae61 )