newfol: ensure database directory exists.

This commit is contained in:
brian m. carlson 2011-09-08 17:41:42 +00:00
parent efaefd32a5
commit e7e4d3fb61

6
newfol
View file

@ -159,7 +159,13 @@ def parse_args(args):
type=int, default=0, help="minimum number of fields per record")
return parser.parse_args(args)
def ensure_db_dir():
path = os.path.expanduser("~/.newfol")
if not os.path.exists(path):
os.mkdir(path, 0o777)
def main(args):
ensure_db_dir()
vault = filemanip.FileStorage('csv', os.path.expanduser("~/.newfol/dtb"))
recs = []
try: