


OpenBSD::Vstat(3pPerl Programmers Reference GuiOpenBSD::Vstat(3p)


NAME
       OpenBSD::Vstat - virtual filesystem for pkg_add(1) simula-
       tions

SYNOPSIS
           use OpenBSD::Vstat;

           $h = OpenBSD::Vstat::add($filename, $size, $tag);
           OpenBSD::Vstat::remove($filename, $size);
           $e = OpenBSD::Vstat::vexists($filename);
           OpenBSD::Vstat::tally();

DESCRIPTION
       "OpenBSD::Vstat" provides functions to layout a virtual
       file system on top of the real one.  This is generally
       used to simulate file system manipulations before doing
       them for real.

       The functions "OpenBSD::Vstat::add" (respectively
       "OpenBSD::Vstat::remove") can be used to add a filename to
       the file system (resp. remove a filename from the file
       system).  The function "OpenBSD::Vstat:vexists" looks for
       a given filename: first it checks if it has been added or
       removed in the virtual filesystem. Failing that, it looks
       into the real file system using "-e".

       Both "OpenBSD::Vstat::add" and "OpenBSD::Vstat::remove"
       also know about Unix filesystem semantics, namely mount(8)
       points and disk usage.  They return a small object corre-
       sponding to the filename's file system with the following
       fields

       ro      defined if the filesystem is read-only. Usually
               hard to add files there.

       nodev   defined if the filesystem forbids devices.

       noexec  defined if the filesystem forbids execution.

       nosuid  defined if the filesystem forbids SUID files.

       avail() returns the number of bytes still available on the
               filesystem.

       "OpenBSD::Vstat::vexists" returns a true value if the
       filename exists.  If it is a virtual name added through
       "OpenBSD::Vstat::add", it returns the $tag specified as an
       optional argument. Otherwise, it returns 1.

       "OpenBSD::Vstat:tally" displays a summary of filesystem
       manipulations after a series of additions and removals.

       Due to the way packages get updated, size modifications
       through "OpenBSD::Vstat::remove" are delayed until the



perl v5.8.8                 2008-03-14                          1





OpenBSD::Vstat(3pPerl Programmers Reference GuiOpenBSD::Vstat(3p)


       next call to "OpenBSD::Vstat::synchronize": old files must
       be removed before adding the new files in order to prop-
       erly account for collisions, but the old files occupy disk
       space while the new package gets extracted.

CAVEATS
       The API to this module may change.

BUGS AND LIMITATIONS
       "OpenBSD::Vstat" now handles chroot(8) situations grace-
       fully, but it doesn't know about symbolic links to direc-
       tories and will report bogus results in complicated cases.













































perl v5.8.8                 2008-03-14                          2


