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
  • 107
  • Free
 
 

Review Filesys::Virtual::Async::inMemory

  • captcha
 

Other software of Apocalypse
    
    New Miscellaneous software
    • SocialMedia driven App Developer  v.3.00If you could look 1 year ahead, would you want to see? The SocialMedia driven App Developer is calculating your Shareware's Success. Fine-tune as many cost-driving parameters as you want. See revenue and net profit results displayed over 48 months.
    • Excavator  v.1.0.11Diggernaut is a cloud based service for web scraping, data extraction and other ETL (Extract, Transform, Load) tasks. If you dont have any programming skills, you can use Excavator tool to build configuration for your scrapers.
    • InstallAware Free Installer  v.X6InstallAware's new Free Installer runs inside Visual Studio and creates setups automatically, by scanning your loaded solutions for dependencies and output files, and including them in your setup. This special edition of InstallAware is freeware!