Filesys::Virtual::Async::inMemory v.0.01

Advertisement
Advertisement

Filesys::Virtual::Async::inMemory is a Perl module to mount filesystems that reside in memory (sort of ramfs).SYNOPSIS #!/usr/bin/perl use strict; use warnings; use Fcntl qw( :DEFAULT :mode ); # S_IFREG S_IFDIR, O_SYNC O_LARGEFILE etc # uncomment this to enable debugging #sub Filesys::Virtual::Async::inMemory::DEBUG { 1 } use Filesys::Virtual::Async::inMemory; # create the filesystem my $vfs = Filesys::Virtual::Async::inMemory->new( 'filesystem' => { '/' => { mode => oct( '040755' ), ctime => time(), }, }, ); # use $vfs as you wish! $vfs->readdir( '/', sub { # should print out nothing my $data = shift; if ( defined $data ) { foreach my $e ( @$data ) { print "entry in / -> $e"; } print "end of listing for /"; } else { print "error reading /"; } do_file_io(); } ); my $fh; sub do_file_io { $vfs->mknod( '/bar', oct( '100644' ), 0, &did_mknod ); } sub did_mknod { if ( $_[0] == 0 ) { # write to it! $vfs->open( '/bar', O_RDWR, 0, &did_open ); } else { print "error mknod /bar"; } } sub did_open { $fh = shift; if ( defined $fh ) { my $buf = "foobar"; $vfs->write( $fh, 0, length( $buf ), $buf, 0, &did_write ); } else { print "error opening /bar"; } } sub did_write { my $wrote = shift; if ( $wrote ) { print "successfully wrote to /bar"; $vfs->close( $fh, &did_close ); } else { print "error writing to /bar"; } } sub did_close { my $status = shift; if ( $status == 0 ) { print "successfuly closed fh"; } else { print "error in closing fh"; } }

Filesys::Virtual::Async::inMemory is a Perl ... Mount filesystems that reside in memory ( sort of ramfs ) ...

 
  • Filesys::Virtual::Async::inMemory
  • 0.01
  • Apocalypse
  • Linux
  • Freeware
  • 20 Kb
  • 109
  • Free
 
 

Review Filesys::Virtual::Async::inMemory

  • captcha
 

Other software of Apocalypse
    
    New Miscellaneous software
    • Bersoft HTML Print  v.9.09This programmer utility for printing HTML pages and images in an invisible way can be called from your application, passing either the file to print or a file list as a parameter.
    • Metamill  v.8.2.2022Metamill is a professional UML modeling tool. Supports UML 2.4 standard. All 14 UML diagrams supported. Round-trip engineering for Python, ADA, Java, C, C++, C# and VB.Net. RTF and HTML document generation. Fast and easy to use. www.metamill.com ...
    • RunETAC  v.2-0.1-6-enaThe ETAC programming language is a general purpose dictionary and stack based interpreted script programming language fully capable of traditional high-level block structured language style syntax.