ag2.1 problem
Robert Olson
olson at mcs.anl.gov
Tue Aug 19 07:22:35 CDT 2003
>At 08:58 AM 8/19/2003 +0100, Michael Daw wrote:
>Pasted below.
Thanks. I'm sort of at a loss as to what exactly is going on there. Can you
run the following program on that machine and send me the output?
--bob
import traceback
import bsddb
import os
import os.path
user = "zzcgumd"
appdir = r"C:\Documents and Settings\%s\Application Data\AccessGrid" % (user)
dbfile = os.path.join(appdir, "testhash.db")
try:
os.unlink(dbfile)
except:
pass
def getstat(path):
try:
xx = os.stat(path)
pred = lambda x: x.startswith("st_")
print "%s:" % (path)
for k in filter(pred, dir(xx)):
print " %s: %s" % (k, getattr(xx, k))
except Exception, e:
print "Error stat %s:\n%s" %(path, e)
print "Before creation\n"
os.system('dir /a "%s"' % (appdir))
getstat(appdir)
getstat(dbfile)
try:
hash = bsddb.hashopen(dbfile, 'n')
hash['test1'] = 'value1'
hash['test2'] = 'value2'
hash.sync()
hash.close()
except Exception, e:
print "error on hash create"
print e
print "After creation"
os.system('dir /a "%s"' % (appdir))
getstat(appdir)
getstat(dbfile)
try:
hash = bsddb.hashopen(dbfile, 'w')
print "hash keys: ", hash.keys()
for k in hash.keys():
print " %s %s" % (k, hash[k])
hash.close()
except Exception, e:
print "error on hash open"
print e
More information about the ag-dev
mailing list