Update date
[filehash.git] / tests / versions.Rout.save
blob338af92355899cbe37089800425c4c4f2cbb15dd
2 R version 2.8.0 (2008-10-20)
3 Copyright (C) 2008 The R Foundation for Statistical Computing
4 ISBN 3-900051-07-0
6 R is free software and comes with ABSOLUTELY NO WARRANTY.
7 You are welcome to redistribute it under certain conditions.
8 Type 'license()' or 'licence()' for distribution details.
10 R is a collaborative project with many contributors.
11 Type 'contributors()' for more information and
12 'citation()' on how to cite R or R packages in publications.
14 Type 'demo()' for some demos, 'help()' for on-line help, or
15 'help.start()' for an HTML browser interface to help.
16 Type 'q()' to quit R.
18 > ## Test databases
19
20 > library(filehash)
21 filehash: Simple key-value database (2.0-1 2008-12-19)
22
23 > testdblist <- dir(pattern = glob2rx("testdb-v*"))
24
25 > for(testname in testdblist) {
26 +         msg <- sprintf("DATABASE: %s\n", testname)
27 +         cat(paste(rep("=", nchar(msg)), collapse = ""), "\n")
28 +         cat(msg)
29 +         cat(paste(rep("=", nchar(msg)), collapse = ""), "\n")
30 +         db <- dbInit(testname, "DB1")
31 +         keys <- dbList(db)
32 +         print(keys)
33
34 +         for(k in keys) {
35 +                 cat("key:", k, "\n")
36 +                 val <- dbFetch(db, k)
37 +                 print(val)
38 +                 cat("\n")
39 +         }
40 + }
41 ====================== 
42 DATABASE: testdb-v1.1
43 ====================== 
44 [1] "a"     "c"     "list"  "entry"
45 key: a 
46  [1] -0.6264538  0.1836433 -0.8356286  1.5952808  0.3295078 -0.8204684
47  [7]  0.4874291  0.7383247  0.5757814 -0.3053884
49 key: c 
50 [1] 1
52 key: list 
53 [[1]]
54 [1] 1
56 [[2]]
57 [1] 2
59 [[3]]
60 [1] 3
62 [[4]]
63 [1] 4
65 [[5]]
66 [1] 5
68 [[6]]
69 [1] 6
71 [[7]]
72 [1] "a"
75 key: entry 
76 [1] "string"
78 ====================== 
79 DATABASE: testdb-v2.0
80 ====================== 
81 [1] "a"     "c"     "list"  "entry"
82 key: a 
83  [1] -0.6264538  0.1836433 -0.8356286  1.5952808  0.3295078 -0.8204684
84  [7]  0.4874291  0.7383247  0.5757814 -0.3053884
86 key: c 
87 [1] 1
89 key: list 
90 [[1]]
91 [1] 1
93 [[2]]
94 [1] 2
96 [[3]]
97 [1] 3
99 [[4]]
100 [1] 4
102 [[5]]
103 [1] 5
105 [[6]]
106 [1] 6
108 [[7]]
109 [1] "a"
112 key: entry 
113 [1] "string"