python (3.12.0)
ˑeJ- ~ d Z ddlZddlZddlZddlZddgZ dZ
eZ G d dej j Zd dZy)
a A dumb and slow but simple dbm clone.
For database spam, spam.dir contains the index (a text file),
spam.bak *may* contain a backup of the index (also a text file),
while spam.dat contains the data (a binary file).
XXX TO DO:
- seems to contain a bug when updating...
- reclaim free space (currently, space once occupied by deleted or expanded
items is never reused)
- support concurrent access (currently, if two processes take turns making
updates, they can mess up the index)
- support efficient access to large databases (currently, the whole index
is read when the database is opened, and some updates rewrite the whole index)
- support opening for read-only (flag = 'm')
Nerroropeni c e Zd ZeZeZddZd Zd Zd ZeZ d Z
d Zd Zd Z
d Zd
Zd Zd Zd
Zd Zd ZeZd Zd ZeZd Zd Zd Zy) _Databasec | j j | }|| _ |dk( | _ |dz | _ |dz | _ |dz | _ d | _ | j | | j | y )Nrs .dirs .dats .bak)
_osfsencode_mode _readonly_dirfile_datfile_bakfile_index_create_update)selffilebasenamemodeflags </BuggyBox/python/3.12.0/bootstrap/lib/python3.12/dbm/dumb.py__init__z_Database.__init__0 ss xx((6
#+ %w.
%w.
$w.
TT c |dk( r>| j | j | j fD ] } t j | t
j | j dd }|j y # t
$ r Y Zw xY w# t
$ r[ |dvr t
j | j dd 5 }| j | j d d d Y y # 1 sw Y Y y xY ww xY w)Nnr Latin-1encodingcr w)
r r r
r removeOSError_ior close_chmod)r r filenamefs r r z_Database._createJ s 3;!]]DMM4==I
JJx(
i@A
GGI
+:%$--yA
+QDMM*
+
+
+ +s; A8"B 8 BB0C+7CC+C' "C+'C+c j d| _ i | _ t j | j dd }|5 |D ]J }|j }t
j | \ }}|j d }|| j |<