$Id: README,v 1.5 2004/12/13 11:13:18 jeffm Exp $

vflow is an attempt at a ruby replacement for the perl Cflow or python pyflowtool modules. This is beta and should be safe for limited use it passes testing by the vftest.rb script.

Installation

To install do the following, when installing from gem,

gem install vflow

If installing manually from tar.gz file,

cd ext ruby extconf.rb make make install

If your flow-tools headers and libraries are not in a common path you can use

–with-ft-include-dir=<include file directory> and –with-ft-lib-dir=<library directory>

as arguments to extconf.rb to specify the paths.

vftest.rb prints flow data from testdata/dummy_flow file vfprofile.rb profiles vflow processing the dummy_flow file

The following methods are defined as part of vflow new()

Creates and returns a vflow object

open(filename)

Open file of filename which has been created by flow-tools for reading.
If a block is given, the file will be automatically closed at the end of the block

close()

Close the current file

currentfile()

return the name of the current file being read from.

next()

Returns a vflowrec object containing the values of the next entry in the file.

each()

This loops over all entries from the current position calling the associated
block. See the example below.

Example 1

require 'Vflow' vf = Vflow.new() vf.open('aflowfile') vf.each() { |r| # do something } vf.close()

Example 2

require 'Vflow' vf = Vflow.new() vf.open('aflowfile') {

vf.each { |r|
       #do something
}

}

To Do

modify open() to take an array of filenames and automatically interate from the end of one to the start of annother. modify open() to take directory names and iterate over each file in the given a directory. add method to extract header info add method to get flow version

Changes

0.3a Patched Vflow.c so #open will take blocks (jeffw@globaldial.com) Altered extconf.rb to use arbitrary paths for ft-lib (jeffw@globaldial.com) Altered extconf.rb to give errors on missing libraries (jeffw@globaldial.com) Altered extconf.rb to use flow-tools from path /usr/local/netflow automatically. Created vflow.gemspec and gem file.

Thanks

Thanks go to the following people,

jpietsch@amazon.com for complaining about it not working. So I know at least one other person is using this library ;-).

jeffw@globaldial.com for his patch so #open could use blocks and altering extconf.rb to give error messages and work with the flow-tools library and includes not being in the library path.