Questions tagged [dbm]

DBM is a simple UNIX database format. It uses a key-value storage and hashing for fast retrieval of the data by key.

98 questions
4
votes
1 answer

Linux - HTPASSWD file too big? (more than 2000 users)

I got here a quite huge HTPASSWD file which stores the users and their encrypted passwords. This file is used to authenticate users using HTTP. I got more than 2000 entries (users) in this file. The size of that file is 116KB. Additionnaly, about…
Jonathan Rioux
  • 1,067
  • 2
  • 14
  • 30
4
votes
1 answer

How often does a device send a wifi probe request?

When a device has wifi enabled, it sends out a wifi probe request, containing your signal strength, SSID, and MAC adress. I was wondering, how often does a device send out this request? I heard that when a device is connected to wifi, it will double…
S. ter Keurs
  • 57
  • 1
  • 9
4
votes
1 answer

Is it possible to get shelve database filename using file object attribute? (python)

I have a python3 script that creates multiple database files using the shelve module. FYI, the shelve module wraps the dbm module, as can be seen in the shelve source code. The shelf.open() method is used to create the database file on disc and…
Lionel Brooks
  • 258
  • 2
  • 7
4
votes
2 answers

Working with files too big to be stored in memory?

I have a 20 gb file which looks like the following: Read name, Start position, Direction, Sequence Note that read names are not neccessarily unique. E.g. a snippet of my file would look like Read1, 40009348, +, AGTTTTCGTA Read2, 40009349, -,…
The Unfun Cat
  • 29,987
  • 31
  • 114
  • 156
4
votes
2 answers

Why use Ruby's DBM library

Is anyone aware of a practical (real-life) use of Ruby's DBM lib? Is it an alternative to more "widespread" persistent key-value stores like Redis ?
Nekosan
  • 145
  • 8
3
votes
2 answers

Perl DBM vs. Storable

for my current project i need to store a little database on disk, that i read once my program runs and write it once. I have looked into perls DBM functionality and from what I understand it provides merely a hash that is stored on disk with every…
NiklasMM
  • 2,895
  • 2
  • 22
  • 26
3
votes
2 answers

Using the dbm module in Python 3

I'm learning about database files and the dbm module in Python 3.1.3, and am having trouble using some of the methods from the anydbm module in Python 2. The keys method works fine, import dbm db = dbm.open('dbm', 'c') db['modest'] =…
yndolok
  • 5,197
  • 2
  • 42
  • 46
3
votes
1 answer

Using dbm.gnu for Python 3.6.8 on macOS

I am having some problems using dbm.gnu for Python 3.6.8 on macOS. I have installed gdbm in my Python virtual environment with conda... but I got the following error message when trying to invoke…
Kris Stern
  • 1,192
  • 1
  • 15
  • 23
2
votes
1 answer

dbm instance is false

In python 2.6.5, an instance of dbm does not have a __nonzero__ or a __len__ method, so why does it evaluate false as a boolean? >>> a = dbm.open( 'foo', 'c' ) >>> if a: print 'true' ... >>>
William Pursell
  • 204,365
  • 48
  • 270
  • 300
2
votes
1 answer

Is dbm.gnu not supported on Python 3.7 Windows?

When doing import dbm.gnu on a standard Python 3.7.6 (64) for Windows, I get: File "C:\Python37\lib\dbm\gnu.py", line 3, in from _gdbm import * ModuleNotFoundError: No module named '_gdbm' Isn't dbm.gnu supported out of the box on Windows? The…
Basj
  • 41,386
  • 99
  • 383
  • 673
2
votes
1 answer

python2.7 missing standard dbm module when install by conda

I want to install python2.7 by conda as follows command: conda create -n tensorflow python=2.7 anaconda But it is missing of dbm module. $ python Python 2.7.15 | packaged by conda-forge | (default, Jul 2 2019, 00:39:44) [GCC 7.3.0] on…
2
votes
2 answers

DBM file is readable by Perl scripts on the machine that made it, but "Inappropriate file type or format" on other machines

I have a Perl script that makes a DBM index of a reference file using the DB_File module. Another Perl script then uses that DBM file. It works fine if I run both the setup and usage scripts on the same machine. However, if I make the DBM file on…
2
votes
2 answers

DBM::Deep: Problems with transactions

I've never done transactions (in terms of programming), therefore I don't know if there is something wrong with my script or something else: #!/usr/bin/env perl use warnings; use 5.012; use DBM::Deep; my $db = DBM::Deep->new( 'foo.db' ); my $trans…
sid_com
  • 24,137
  • 26
  • 96
  • 187
2
votes
1 answer

Keep several Lua tables in a small database?

I am writing a small standalone Lua tool which uses several key/value pairs in trees as data storage. My prototype is using Lua tables, they fit perfectly for my task. However the table entries change and grow continuously. For me, that seems a good…
smartmic
  • 661
  • 5
  • 15
2
votes
2 answers

Does Python's shelve module use memory-mapped IO?

Does anyone know if Python's shelve module uses memory-mapped IO? Maybe that question is a bit misleading. I realize that shelve uses an underlying dbm-style module to do its dirty work. What are the chances that the underlying module uses…
Matt Luongo
  • 14,371
  • 6
  • 53
  • 64