Search code examples
perlberkeley-db

What does R_CURSOR mean in DB_File?


I've been trying to replace BerkeleyDB module in some old Perl with DB_File ties. Reading the DB_File documentation on CPAN is helpful, but not complete. It mentions some flags to use for put, tie, etc and I'm not sure what they mean. R_CURSOR is one of those.

Specifically, if I use put with R_CURSOR, what does that mean?


Solution

  • Try man dbopen for the C level API which describes these flags, as DB_file is really a very thin wrapper around that.

    The meaning of this flag differs according to which method you use it on, when used with put this means that a value is replaced (rather than added before or after) and needs to be used after an existing search, i.e., after using the seq function at the C level.