mqs::spool - Perl extension for management of spools
use mqs::spool;
%spool = initspooldirectory($dir)
$entire_file_name = newfilename($dir)
$int = putinspool(\%spool,$content,$priority)
$int = delfile($file)
($content,$priority) = readfile($file)
@list_of_files = listfiles(\%spool,$priority)
$int = putinspoot(\%spool,$content,$priority)
mqs::spool is a module for Perl to manage big or very big spool.
If $priority == 1, then the tabular returned is done with the priority, in all other cases, the tabular returned is the list of files as the function found them in the spool.
$priority is an int between 1 to 5, other priorities will be accepted by the functions, but the files will not be read by the listfiles function whent the priority function is activated (dangerous)
More you have files in a directory, more the read or the write in this directory become slow. mqs::spool manage a spool of 32 directories (you can increase this number in the sources of the module by increase the value of $size_spool).
A spool is defined by a very simple hash table. It contains informations about the seat and the type of spool (tcp type of spool will soon come), it is returned by the fonction initspooldirectory.
It's better to run initspooldirectory each time you want to use a spool, this one will check if the spool exists and create or modify it (if you modified the size by default of a spool) if not.
You can see the sources of test.pl to see how to use others functions in your source code.
initspooldirectory newfilename putinspool listfiles delfile readfile
Stephane TOUGARD elair@darea.fr
perl(1).
To install mqs::spool, copy and paste the appropriate command in to your terminal.
cpanm
cpanm mqs::spool
CPAN shell
perl -MCPAN -e shell install mqs::spool
For more information on module installation, please visit the detailed CPAN module installation guide.