-
Notifications
You must be signed in to change notification settings - Fork 1
Mounting
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->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->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.
Filesys::Virtual does not use dir handles. Dirs created or are in a single operation. So implementation is much simpler.