Skip to content
sauber edited this page Jan 21, 2012 · 1 revision

Files

A critical goal for ABFS is ot be mountable as a file system, so that no particular tools are required for access to an ABFS file system. Writing a unix kernel driver or windows file system driver is hard, so a choice of userland implementation is better. For both unix and windows, mounting a webdav file system is easy.

The Net::DAV::Server is a webdav server implementation in perl. It requires a file system to be available that is inherited from Filesys::Virtual. Filesys::Virtual returns file handles in open() calls, which are of IO::File type. IO::File inherits from IO::Handle and IO::Seekable where the following functions are implemented:

IO::Handle

$io->close
$io->eof
$io->fileno
$io->format_write( [FORMAT_NAME] )
$io->getc
$io->read ( BUF, LEN, [OFFSET] )
$io->print ( ARGS )
$io->printf ( FMT, [ARGS] )
$io->say ( ARGS )
$io->stat
$io->sysread ( BUF, LEN, [OFFSET] )
$io->syswrite ( BUF, [LEN, [OFFSET]] )
$io->truncate ( LEN )

IO::Seekable

$io->getpos
$io->setpos
$io->seek ( POS, WHENCE )
$io->sysseek( POS, WHENCE )
$io->tell

ABFS will have to create Filesys::Virtual::ABFS that uses IO::File::ABFS file access compatible with above.

Beside being usable inside Net::DAV::Server, it can also be used inside POE::Component::Server::FTP

IO::File uses blocking lib call. So a communication with ABFS daemon has to be established somehow that can keep file handles open.

Dirs

Filesys::Virtual does not use dir handles. Dirs created or are in a single operation. So implementation is much simpler.

Clone this wiki locally