


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


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

SYNOPSIS
           use OpenBSD::Vstat;

           my $v = OpenBSD::Vstat->new($state);

           $h = $v->add($filename, $size, $tag);
           $v->remove($filename, $size);
           $e = $v->exists($filename);
           $v->tally;

DESCRIPTION
       "OpenBSD::Vstat" provides methods 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 constructor "new" expect a $state object, that is, an
       object with "$state->{not}" and "$state->errsay" defined.

       The method "add" (respectively "remove") can be used to
       add a filename to the file system (resp. remove a filename
       from the file system).  The method "exists" 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 "add" and "remove" also know about Unix filesystem
       semantics, namely mount(8) points and disk usage.  They
       return a small object corresponding to the filename's file
       system with the following methods

       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.

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

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



perl v5.10.1                2010-01-02                          1





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


       Due to the way packages get updated, size modifications
       through "remove" are delayed until the next call to
       "synchronize": old files must be removed before adding the
       new files in order to properly account for collisions, but
       the old files occupy disk space while the new package gets
       extracted.

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













































perl v5.10.1                2010-01-02                          2


