A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2001-November/018778.html below:

[Python-Dev] Re: problems with DBM nonuniformity

[Python-Dev] Re: problems with DBM nonuniformitySkip Montanaro skip@pobox.com (Skip Montanaro)
Thu, 29 Nov 2001 19:35:05 -0600
    Jason> On Linux, "whitelist.db" = whitelist.db when the default module is
    Jason> dbhash, so there is no problem:

    ...

    Jason> However on Solaris for example (default module of dbm):

    Jason> % python -c "import anydbm;wl = anydbm.open('whitelist.db','c')" 
    Jason> % ls -l whitelist*
    Jason> -rw-------   1 jason    users           0 Nov 29 19:13 whitelist.db.dir
    Jason> -rw-------   1 jason    users           0 Nov 29 19:13 whitelist.db.pag

    Jason> Under Linux, the dbm module acts differently, adding a '.db'
    Jason> suffix to the given filename:

    Jason> % python -c "import dbm;wl = dbm.open('whitelist.db','c')"
    Jason> % ls -l whitelist*
    Jason> -rw-------    1 jasonrm  acl         16384 Nov 29 17:21 whitelist.db.db

    Jason> So, I can't rely on comparing "whitelist" with "whitelist.db"
    Jason> filename to filename since the latter might not exist.

    ...

    Jason> Does anyone have some suggestions on how I might support this
    Jason> feature in a cross-platform, and generic fashion?

Seems to me the natural thing to do would be to add "get_data_filename" and
"get_index_filename" methods (or something similar) to the underlying
modules (dbhash, bsddb, dbm, etc) and expose them through anydbm.

It's too late for 2.2, but I suspect if you implemented something and method
name(s) could be settled on it would make it into CVS early in the 2.3
cycle.  This seems like a small enough change that you just file a bug
report on SourceForge with the proposal and add an implementation when you
have something workable.

-- 
Skip Montanaro (skip@pobox.com - http://www.mojam.com/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4