diff --git a/work.py b/work.py --- a/work.py +++ b/work.py @@ -86,7 +86,7 @@ def transferChanges(targetPath): # transfer modified sectors and mark them as clean sectorIds=handle.fetchall() - for (sectorId,) in sectorIds: + '''for (sectorId,) in sectorIds: path=targetPath / getPath(sectorId) try: path.parent.mkdir(parents=True) except FileExistsError: pass @@ -94,16 +94,31 @@ def transferChanges(targetPath): sf.seek(sectorId) df.write(sf.read(BLOCK_SIZE)) handle.execute("""update `hashes` set `dirty`=0 where `sector_id`=?""",(sectorId,)) - db.commit() + db.commit()''' + sector=sf.read(BLOCK_SIZE) + i=j=0 + while sector and j