Any::Daemon::HTTP::Directory - describe a server directory
Any::Daemon::HTTP::Directory is an Any::Daemon::HTTP::Source Any::Daemon::HTTP::Directory is extended by Any::Daemon::HTTP::UserDirs
# implicit creation of ::Directory object my $vh = Any::Daemon::HTTP::VirtualHost ->new(directories => {path => '/', location => ...}) my $vh = Any::Daemon::HTTP::VirtualHost ->new(directories => [ \%dir1, \%dir2, $dir_obj ]) # explicit use my $root = Any::Daemon::HTTP::Directory ->new(path => '/', location => '...'); my $vh = Any::Daemon::HTTP::VirtualHost ->new(directories => $root);
Each Any::Daemon::HTTP::VirtualHost will define where the files are located. Parts of the URI path can map on different (virtual) directories, with different access rights.
Extends "DESCRIPTION" in Any::Daemon::HTTP::Source.
Extends "METHODS" in Any::Daemon::HTTP::Source.
Extends "Constructors" in Any::Daemon::HTTP::Source.
-Option --Defined in --Default allow Any::Daemon::HTTP::Source <undef> charset utf-8 deny Any::Daemon::HTTP::Source <undef> directory_list <false> index_file ['index.html', 'index.htm'] location <required> name Any::Daemon::HTTP::Source path path Any::Daemon::HTTP::Source '/'
The character-set which is used all text-files on the system, used in response headers of text-files.
Enables the display of a directory, when it does not contain one of the index_file prepared defaults.
index_file
When a directory is addressed, it is scanned whether one of these files exist. If so, the content will be shown.
The DIRECTORY to be prefixed before the path of the URI, or a CODE reference which will rewrite the path (passed as only parameter) into the absolute file or directory name.
Extends "Attributes" in Any::Daemon::HTTP::Source.
Inherited, see "Attributes" in Any::Daemon::HTTP::Source
Extends "Permissions" in Any::Daemon::HTTP::Source.
Inherited, see "Permissions" in Any::Daemon::HTTP::Source
Extends "Actions" in Any::Daemon::HTTP::Source.
Convert a URI $path into a directory path. Return undef if not possible.
undef
Returns a HASH with information about the $directory content. This may be passed into some template or the default template. See "Return of directoryList" about the returned output.
-Option --Default filter <undef> hide_symlinks <false> names <skip hidden files>
For each of the selected names (see names option) the lstat() is called. That data is expanded into a HASH, but not all additional fields are yet filled-in (only the ones which come for free).
names
Reduce the returned list. The CODE reference is called with the found filename, and should return true when the name is acceptable. The default regexp (on UNIX) is qr/^[^.]/
qr/^[^.]/
Extends "DETAILS" in Any::Daemon::HTTP::Source.
Extends "Resource restrictions" in Any::Daemon::HTTP::Source.
The list() method returns a HASH of HASHes, where the primary keys are the directory entries, each refering to a HASH with details. It is designed to ease the connection to template systems.
The details contain the lstat information plus some additional helpers. The lstat call provides the fields dev, ino, mode, nlink, uid, gid, rdev, size, atime, mtime, ctime, blksize, blocks -as far as supported by your OS. The entry's name and path are added.
lstat
dev
ino
mode
nlink
uid
gid
rdev
size
atime
mtime
ctime
blksize
blocks
name
path
The kind field contains the string DIRECTORY, FILE, SYMLINK, or OTHER. Besides, you get either an is_directory, is_file, is_symlink, or is_other field set to true. Equivalent are:
kind
DIRECTORY
FILE
SYMLINK
OTHER
is_directory
is_file
is_symlink
is_other
if($entry->{kind} eq 'DIRECTORY') if($entry->{is_directory})
It depends on the kind of entry which of the following fields are added additionally. Symlinks will get symlink_dest, symlink_dest_exists. Files hace the size_nice, which is the size in pleasant humanly readable format.
symlink_dest
symlink_dest_exists
size_nice
Files and directories have the mtime_nice (in localtime). The user and group which are textual representations of the numeric uid and gid are added. The flags represents the UNIX standard permission-bit display, as produced by the "ls -l" command.
mtime_nice
user
group
flags
This module is part of Any-Daemon-HTTP distribution version 0.30, built on April 06, 2020. Website: http://perl.overmeer.net/any-daemon/
Copyrights 2013-2020 by [Mark Overmeer]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
To install Any::Daemon::HTTP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Any::Daemon::HTTP
CPAN shell
perl -MCPAN -e shell install Any::Daemon::HTTP
For more information on module installation, please visit the detailed CPAN module installation guide.