Config::Tree::BaseFS - Base class for Config::Tree classes which access filesystem


Config-Tree documentation  | view source Contained in the Config-Tree distribution.

Index


NAME

Top

Config::Tree::BaseFS - Base class for Config::Tree classes which access filesystem

SYNOPSIS

Top

 # Moose-speak
 extends 'Config::Tree::BaseFS';

DESCRIPTION

Top

This base class provides some (mostly internal) methods which deals with reading/writing files/directories.

Currently Config::Tree::File and Config::Tree::Dir derive from this class.

ATTRIBUTES

Top

path (rw)

The path to config file (for Config::Tree::File) or directory (for Config::Tree::Dir). Maybe relative or absolute path.

allow_different_owner (rw, default 0)

Whether to allow writing to files/directories which have different owner as the running user. By default this is 0, to protect root from writing to user-controlled directories. Although this module uses safe writing to avoid symlink attacks (when allow_symlink is 0/1 anyway), due to other issues, it is not recommended for root to write to user-controlled directories. Make sure you know exactly what you are doing if you turn this on.

file_mode (rw, default 0644)

What permission mode to create new files.

dir_mode (rw, default 0755)

What permission mode to create new directories.

yaml_module (ro, default 'YAML::XS')

Which YAML module to use. Default is 'YAML::XS', but will fall back to 'YAML' (YAML.pm) if the first is unavailable. You can use either 'YAML::XS', 'YAML', 'YAML::Syck', or 'YAML::Tiny'.

must_exist (rw, default 0)

If set to 1, then the file/dir must exist and an error is thrown if it doesn't.

METHODS

Top

SEE ALSO

Top

Config::Tree::Base, Config::Tree::File, Config::Tree::Dir

AUTHOR

Top

Steven Haryanto, <stevenharyanto at gmail.com>

COPYRIGHT & LICENSE

Top


Config-Tree documentation  | view source Contained in the Config-Tree distribution.