1*f902ef06Sespie$OpenBSD: Mtree.pod,v 1.2 2023/05/16 14:04:16 espie Exp $ 26e49571cSdaniel 36e49571cSdaniel=head1 NAME 46e49571cSdaniel 56e49571cSdanielOpenBSD::Mtree - simple C<mtree(8)> spec parser 66e49571cSdaniel 76e49571cSdaniel=head1 SYNOPSIS 86e49571cSdaniel 96e49571cSdaniel use OpenBSD::Mtree; 106e49571cSdaniel 116e49571cSdaniel my %hier; 126e49571cSdaniel 13*f902ef06Sespie OpenBSD::Mtree::parse(\%hier, "/", "/etc/mtree/4.4BSD.dist", $extra); 146e49571cSdaniel 156e49571cSdaniel=head1 DESCRIPTION 166e49571cSdaniel 176e49571cSdanielC<OpenBSD::Mtree> is a parser for C<mtree(8)> specifications that 186e49571cSdanielcan reconstruct directory hierarchies. 196e49571cSdaniel 20*f902ef06SespieThe basic function C<OpenBSD::Mtree::parse_fh(\%hash, $basedir, $fh, $extra)> 216e49571cSdanielwill populate the hash C<$hash> with defined entries for each directory 226e49571cSdanielseen while reading from C<$fh>, assuming the specification is to be interpreted 236e49571cSdanielrelative to C<$basedir> (some canonicalization of directory names will 246e49571cSdanieloccur). 256e49571cSdaniel 26*f902ef06SespieIf C<$extra> is non null, each entry will itself be an empty hash. 27*f902ef06Sespie 28*f902ef06SespieC<OpenBSD::Mtree:parse(\%hash, $basedir, $filename, $extra)> is a convenience 296e49571cSdanielfunction which also handles opening the filehandle from C<$filename> 306e49571cSdanieland closing it after reading the specification. 31