Filesys-POSIX

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

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

lib/Filesys/POSIX.pm  view on Meta::CPAN

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

=over

=item * 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.

=item * EBUSY (Device or resource busy)

The directory specified is an active mount point.

=item * ENOTDIR (Not a directory)

The inode found at C<$path> is not a directory.

=item * ENOTEMPTY (Directory not empty)

The directory is not empty.

t/mount.t  view on Meta::CPAN

        "Filesys::POSIX->getcwd() reports / after a chdir('..')"
    );
}

{
    my $fd = $fs->open( '/mnt/mem/test.txt', $O_CREAT );

    throws_errno_ok {
        $fs->unmount('/mnt/mem');
    }
    &Errno::EBUSY, "Filesys::POSIX->unmount() prevents unmounting busy filesystem /mnt/mem";

    $fs->close($fd);
    $fd = $fs->open( '/foo.txt', $O_CREAT );

    throws_errno_ok {
        $fs->unmount('/mnt/mem');
    }
    &Errno::EBUSY, "Filesys::POSIX->unmount() prevents unmounting busy filesystem /mnt/mem";

    throws_errno_ok {
        $fs->chdir('/mnt/mem');
        $fs->unmount('/mnt/mem');
    }
    &Errno::EBUSY, "Filesys::POSIX->unmount() fails when cwd is /mnt/mem";

    $fs->chdir('/');

    $fs->close($fd);



( run in 0.245 second using v1.01-cache-2.11-cpan-87723dcf8b7 )