NAME
Filesys::POSIX::Userland - Provide implementations for higher-level, "userland" functionality in Filesys::POSIX
DESCRIPTION
This module is a mixin imported by Filesys::POSIX into its own namespace, and provides a variety of higher-level calls to supplement the normal suite of system calls provided in Filesys::POSIX itself.
METHODS
$fs->mkpath($path)
$fs->mkpath($path, $mode)
-
Similar to the
-p
flag that can be passed to mkdir(1), this method attempts to create a hierarchy of directories specified in$path
. Each path component created will be made with the mode specified by$mode
, if any, if a directory in that location does not already exist. Exceptions will be thrown if one of the items along the path hierarchy exists but is not a directory.A default mode of 0777 is assumed; only the permissions field of
$mode
is used when it is specified. In both cases, the mode specified is modified with exclusive OR by the current umask value. $fs->getcwd
-
Returns a string representation of the current working directory.
$fs->realpath($path)
-
Returns a string representation of the full, true and original path of the inode specified by
$path
.Using
$fs->stat
, the inode of$path
is resolved, then starting at that inode, each subsequent inode's name is found from its parent and appended to a list of path components. $fs->opendir($path)
-
Returns a newly opened directory handle for the item pointed to by
$path
. Using other methods in this module, the directory can be read and closed. $fs->readdir($directory)
-
Read the next member of the directory passed. Returns undef if there are no more entries to be read.
$fs->closedir($directory)
-
Closes the directory handle for reading.
$fs->touch($path)
-
Acts like the userland utility touch(). Uses
$fs->open
with the$O_CREAT
flag to open the file specified by$path
, and immediately closes the file descriptor returned. This causes an update of the inode modification time for existing files, and the creation of new, empty files otherwise.
AUTHOR
Written by Xan Tronix <xan@cpan.org>
CONTRIBUTORS
COPYRIGHT
Copyright (c) 2014, cPanel, Inc. Distributed under the terms of the Perl Artistic license.