xref: /openbsd/usr.sbin/pkg_add/OpenBSD/Mtree.pod (revision 73471bf0)
1$OpenBSD: Mtree.pod,v 1.1 2020/12/20 15:30:58 daniel Exp $
2
3=head1 NAME
4
5OpenBSD::Mtree - simple C<mtree(8)> spec parser
6
7=head1 SYNOPSIS
8
9    use OpenBSD::Mtree;
10
11    my %hier;
12
13    OpenBSD::Mtree::parse(\%hier, "/", "/etc/mtree/4.4BSD.dist");
14
15=head1 DESCRIPTION
16
17C<OpenBSD::Mtree> is a parser for C<mtree(8)> specifications that
18can reconstruct directory hierarchies.
19
20The basic function C<OpenBSD::Mtree::parse_fh(\%hash, $basedir, $fh)>
21will populate the hash C<$hash> with defined entries for each directory
22seen while reading from C<$fh>, assuming the specification is to be interpreted
23relative to C<$basedir> (some canonicalization of directory names will
24occur).
25
26C<OpenBSD::Mtree:parse(\%hash, $basedir, $filename)> is a convenience
27function which also handles opening the filehandle from C<$filename>
28and closing it after reading the specification.
29