home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / python / pytexdoc / ext / lib / lib1 / dbm / tex
LaTeX Document  |  1996-11-08  |  1.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: LaTeX Document (document/latex).

You can browse this item here: tex

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 42 75 69 6c 74 2d 69 |\section|{Built-i|
|00000010| 6e 20 4d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |n Module| \sectco|
|00000020| 64 65 7b 64 62 6d 7d 7d | 0a 5c 62 69 6d 6f 64 69 |de{dbm}}|.\bimodi|
|00000030| 6e 64 65 78 7b 64 62 6d | 7d 0a 0a 54 68 65 20 5c |ndex{dbm|}..The \|
|00000040| 63 6f 64 65 7b 64 62 6d | 7d 20 6d 6f 64 75 6c 65 |code{dbm|} module|
|00000050| 20 70 72 6f 76 69 64 65 | 73 20 61 6e 20 69 6e 74 | provide|s an int|
|00000060| 65 72 66 61 63 65 20 74 | 6f 20 74 68 65 20 7b 5c |erface t|o the {\|
|00000070| 55 4e 49 58 7d 0a 5c 63 | 6f 64 65 7b 28 6e 29 64 |UNIX}.\c|ode{(n)d|
|00000080| 62 6d 7d 20 6c 69 62 72 | 61 72 79 2e 20 20 44 62 |bm} libr|ary. Db|
|00000090| 6d 20 6f 62 6a 65 63 74 | 73 20 62 65 68 61 76 65 |m object|s behave|
|000000a0| 20 6c 69 6b 65 20 6d 61 | 70 70 69 6e 67 73 0a 28 | like ma|ppings.(|
|000000b0| 64 69 63 74 69 6f 6e 61 | 72 69 65 73 29 2c 20 65 |dictiona|ries), e|
|000000c0| 78 63 65 70 74 20 74 68 | 61 74 20 6b 65 79 73 20 |xcept th|at keys |
|000000d0| 61 6e 64 20 76 61 6c 75 | 65 73 20 61 72 65 20 61 |and valu|es are a|
|000000e0| 6c 77 61 79 73 20 73 74 | 72 69 6e 67 73 2e 0a 50 |lways st|rings..P|
|000000f0| 72 69 6e 74 69 6e 67 20 | 61 20 64 62 6d 20 6f 62 |rinting |a dbm ob|
|00000100| 6a 65 63 74 20 64 6f 65 | 73 6e 27 74 20 70 72 69 |ject doe|sn't pri|
|00000110| 6e 74 20 74 68 65 20 6b | 65 79 73 20 61 6e 64 20 |nt the k|eys and |
|00000120| 76 61 6c 75 65 73 2c 20 | 61 6e 64 20 74 68 65 0a |values, |and the.|
|00000130| 5c 63 6f 64 65 7b 69 74 | 65 6d 73 28 29 7d 20 61 |\code{it|ems()} a|
|00000140| 6e 64 20 5c 63 6f 64 65 | 7b 76 61 6c 75 65 73 28 |nd \code|{values(|
|00000150| 29 7d 20 6d 65 74 68 6f | 64 73 20 61 72 65 20 6e |)} metho|ds are n|
|00000160| 6f 74 20 73 75 70 70 6f | 72 74 65 64 2e 0a 0a 53 |ot suppo|rted...S|
|00000170| 65 65 20 61 6c 73 6f 20 | 74 68 65 20 5c 63 6f 64 |ee also |the \cod|
|00000180| 65 7b 67 64 62 6d 7d 20 | 6d 6f 64 75 6c 65 2c 20 |e{gdbm} |module, |
|00000190| 77 68 69 63 68 20 70 72 | 6f 76 69 64 65 73 20 61 |which pr|ovides a|
|000001a0| 20 73 69 6d 69 6c 61 72 | 20 69 6e 74 65 72 66 61 | similar| interfa|
|000001b0| 63 65 0a 75 73 69 6e 67 | 20 74 68 65 20 47 4e 55 |ce.using| the GNU|
|000001c0| 20 47 44 42 4d 20 6c 69 | 62 72 61 72 79 2e 0a 5c | GDBM li|brary..\|
|000001d0| 62 69 6d 6f 64 69 6e 64 | 65 78 7b 67 64 62 6d 7d |bimodind|ex{gdbm}|
|000001e0| 0a 0a 54 68 65 20 6d 6f | 64 75 6c 65 20 64 65 66 |..The mo|dule def|
|000001f0| 69 6e 65 73 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |ines the| followi|
|00000200| 6e 67 20 63 6f 6e 73 74 | 61 6e 74 20 61 6e 64 20 |ng const|ant and |
|00000210| 66 75 6e 63 74 69 6f 6e | 73 3a 0a 0a 5c 72 65 6e |function|s:..\ren|
|00000220| 65 77 63 6f 6d 6d 61 6e | 64 7b 5c 69 6e 64 65 78 |ewcomman|d{\index|
|00000230| 73 75 62 69 74 65 6d 7d | 7b 28 69 6e 20 6d 6f 64 |subitem}|{(in mod|
|00000240| 75 6c 65 20 64 62 6d 29 | 7d 0a 5c 62 65 67 69 6e |ule dbm)|}.\begin|
|00000250| 7b 65 78 63 64 65 73 63 | 7d 7b 65 72 72 6f 72 7d |{excdesc|}{error}|
|00000260| 0a 52 61 69 73 65 64 20 | 6f 6e 20 64 62 6d 2d 73 |.Raised |on dbm-s|
|00000270| 70 65 63 69 66 69 63 20 | 65 72 72 6f 72 73 2c 20 |pecific |errors, |
|00000280| 73 75 63 68 20 61 73 20 | 49 2f 4f 20 65 72 72 6f |such as |I/O erro|
|00000290| 72 73 2e 20 5c 63 6f 64 | 65 7b 4b 65 79 45 72 72 |rs. \cod|e{KeyErr|
|000002a0| 6f 72 7d 20 69 73 0a 72 | 61 69 73 65 64 20 66 6f |or} is.r|aised fo|
|000002b0| 72 20 67 65 6e 65 72 61 | 6c 20 6d 61 70 70 69 6e |r genera|l mappin|
|000002c0| 67 20 65 72 72 6f 72 73 | 20 6c 69 6b 65 20 73 70 |g errors| like sp|
|000002d0| 65 63 69 66 79 69 6e 67 | 20 61 6e 20 69 6e 63 6f |ecifying| an inco|
|000002e0| 72 72 65 63 74 20 6b 65 | 79 2e 0a 5c 65 6e 64 7b |rrect ke|y..\end{|
|000002f0| 65 78 63 64 65 73 63 7d | 0a 0a 5c 62 65 67 69 6e |excdesc}|..\begin|
|00000300| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 6f 70 65 6e 7d |{funcdes|c}{open}|
|00000310| 7b 66 69 6c 65 6e 61 6d | 65 5c 2c 20 5c 6f 70 74 |{filenam|e\, \opt|
|00000320| 69 6f 6e 61 6c 7b 66 6c | 61 67 5c 2c 20 5c 6f 70 |ional{fl|ag\, \op|
|00000330| 74 69 6f 6e 61 6c 7b 6d | 6f 64 65 7d 7d 7d 0a 4f |tional{m|ode}}}.O|
|00000340| 70 65 6e 20 61 20 64 62 | 6d 20 64 61 74 61 62 61 |pen a db|m databa|
|00000350| 73 65 20 61 6e 64 20 72 | 65 74 75 72 6e 20 61 20 |se and r|eturn a |
|00000360| 64 62 6d 20 6f 62 6a 65 | 63 74 2e 20 20 54 68 65 |dbm obje|ct. The|
|00000370| 20 5c 76 61 72 7b 66 69 | 6c 65 6e 61 6d 65 7d 0a | \var{fi|lename}.|
|00000380| 61 72 67 75 6d 65 6e 74 | 20 69 73 20 74 68 65 20 |argument| is the |
|00000390| 6e 61 6d 65 20 6f 66 20 | 74 68 65 20 64 61 74 61 |name of |the data|
|000003a0| 62 61 73 65 20 66 69 6c | 65 20 28 77 69 74 68 6f |base fil|e (witho|
|000003b0| 75 74 20 74 68 65 20 5c | 66 69 6c 65 7b 2e 64 69 |ut the \|file{.di|
|000003c0| 72 7d 20 6f 72 0a 5c 66 | 69 6c 65 7b 2e 70 61 67 |r} or.\f|ile{.pag|
|000003d0| 7d 20 65 78 74 65 6e 73 | 69 6f 6e 73 29 2e 0a 0a |} extens|ions)...|
|000003e0| 54 68 65 20 6f 70 74 69 | 6f 6e 61 6c 20 5c 76 61 |The opti|onal \va|
|000003f0| 72 7b 66 6c 61 67 7d 20 | 61 72 67 75 6d 65 6e 74 |r{flag} |argument|
|00000400| 20 63 61 6e 20 62 65 0a | 5c 63 6f 64 65 7b 27 72 | can be.|\code{'r|
|00000410| 27 7d 20 28 74 6f 20 6f | 70 65 6e 20 61 6e 20 65 |'} (to o|pen an e|
|00000420| 78 69 73 74 69 6e 67 20 | 64 61 74 61 62 61 73 65 |xisting |database|
|00000430| 20 66 6f 72 20 72 65 61 | 64 69 6e 67 20 6f 6e 6c | for rea|ding onl|
|00000440| 79 20 2d 2d 2d 20 64 65 | 66 61 75 6c 74 29 2c 0a |y --- de|fault),.|
|00000450| 5c 63 6f 64 65 7b 27 77 | 27 7d 20 28 74 6f 20 6f |\code{'w|'} (to o|
|00000460| 70 65 6e 20 61 6e 20 65 | 78 69 73 74 69 6e 67 20 |pen an e|xisting |
|00000470| 64 61 74 61 62 61 73 65 | 20 66 6f 72 20 72 65 61 |database| for rea|
|00000480| 64 69 6e 67 20 61 6e 64 | 20 77 72 69 74 69 6e 67 |ding and| writing|
|00000490| 29 2c 0a 5c 63 6f 64 65 | 7b 27 63 27 7d 20 28 77 |),.\code|{'c'} (w|
|000004a0| 68 69 63 68 20 63 72 65 | 61 74 65 73 20 74 68 65 |hich cre|ates the|
|000004b0| 20 64 61 74 61 62 61 73 | 65 20 69 66 20 69 74 20 | databas|e if it |
|000004c0| 64 6f 65 73 6e 27 74 20 | 65 78 69 73 74 29 2c 20 |doesn't |exist), |
|000004d0| 6f 72 0a 5c 63 6f 64 65 | 7b 27 6e 27 7d 20 28 77 |or.\code|{'n'} (w|
|000004e0| 68 69 63 68 20 61 6c 77 | 61 79 73 20 63 72 65 61 |hich alw|ays crea|
|000004f0| 74 65 73 20 61 20 6e 65 | 77 20 65 6d 70 74 79 20 |tes a ne|w empty |
|00000500| 64 61 74 61 62 61 73 65 | 29 2e 0a 0a 54 68 65 20 |database|)...The |
|00000510| 6f 70 74 69 6f 6e 61 6c | 20 5c 76 61 72 7b 6d 6f |optional| \var{mo|
|00000520| 64 65 7d 20 61 72 67 75 | 6d 65 6e 74 20 69 73 20 |de} argu|ment is |
|00000530| 74 68 65 20 5c 55 4e 49 | 58 7b 7d 20 6d 6f 64 65 |the \UNI|X{} mode|
|00000540| 20 6f 66 20 74 68 65 20 | 66 69 6c 65 2c 20 75 73 | of the |file, us|
|00000550| 65 64 0a 6f 6e 6c 79 20 | 77 68 65 6e 20 74 68 65 |ed.only |when the|
|00000560| 20 64 61 74 61 62 61 73 | 65 20 68 61 73 20 74 6f | databas|e has to|
|00000570| 20 62 65 20 63 72 65 61 | 74 65 64 2e 20 20 49 74 | be crea|ted. It|
|00000580| 20 64 65 66 61 75 6c 74 | 73 20 74 6f 20 6f 63 74 | default|s to oct|
|00000590| 61 6c 0a 5c 63 6f 64 65 | 7b 30 36 36 36 7d 2e 0a |al.\code|{0666}..|
|000005a0| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0a |\end{fun|cdesc}. |
+--------+-------------------------+-------------------------+--------+--------+