BTRIEVE::FileIO - Btrieve file I/O operations
use BTRIEVE::FileIO(); my $B = BTRIEVE::FileIO->Open('TEST.BTR'); $B->{Size} = 13; for ( $B->StepFirst; $B->IsOk; $B->StepNext ) { print join(':', unpack('A3A10', $B->{Data} ) ), "\n"; } $B->{Key} = 103; for ( $B->GetEqual; $B->IsOk; $B->GetNext ) { print join(':', unpack('A3A10', $B->{Data} ) ), "\n"; }
This module provides methods for common Btrieve operations.
Creates a Btrieve file. This is a constructor method and returns an BTRIEVE::FileIO object.
$FileSpec is a hash reference with the following defaults:
LogicalRecordLength => 128 PageSize => 512 FileFlags => 0 NumberOfDuplicatePointersToReserve => 0 Allocation => 0
$KeySpecs is an array reference of hash references with the following defaults:
KeyPosition => 1 KeyLength => 1 KeyFlags => 0 ExtendedDataType => 0 NullValue => 0 ManuallyAssignedKeyNumber => 0
Opens a Btrieve file. This is a constructor method and returns an BTRIEVE::FileIO object.
Closes a Btrieve file associated with an BTRIEVE::FileIO object. This method is called automatically from within DESTROY.
Tests the Status property. It returns true if Status indicates success and false if Status indicates an error.
Inserts $Data into the Btrieve file. If $Data is omitted, the Data property is used instead.
Retrieves the physical first record of the file.
Retrieves the physical last record of the file.
Retrieves the physical next record of the file.
Retrieves the physical previous record of the file.
Retrieves the logical first record of the file, based on the KeyNum property.
Retrieves the logical last record of the file, based on the KeyNum property.
Retrieves a record which key is equal to the one specified by the Key/KeyNum properties.
Retrieves a record which key is greater than the one specified by the Key/KeyNum properties.
Retrieves the logical next record of the file.
Retrieves the logical previous record of the file.
The data buffer used to transfer data from and to the Btrieve file.
The size of the data buffer. Default is 255.
The number of the key used for logical (key based) data retrieval operations. Default is 0.
The buffer of the key used for logical (key based) data retrieval operations.
The status code. This is the return value of the native Btrieve call. It contains 0 for success or a native error code.
Steffen Goeldner <sgoeldner@cpan.org>
Copyright (c) 2004 Steffen Goeldner. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl, BTRIEVE::Native.
To install BTRIEVE::FileIO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BTRIEVE::FileIO
CPAN shell
perl -MCPAN -e shell install BTRIEVE::FileIO
For more information on module installation, please visit the detailed CPAN module installation guide.