ignore >100MB files

This commit is contained in:
Damien Elmes 2014-07-30 04:32:18 +09:00
parent 3ee1937310
commit dd2b6cb07d

View file

@ -381,9 +381,13 @@ create table meta (dirMod int, lastUsn int); insert into meta values (0, 0);
if self.hasIllegal(f):
continue
# empty files are invalid; clean them up and continue
if not os.path.getsize(f):
sz = os.path.getsize(f)
if not sz:
os.unlink(f)
continue
if sz > 100*1024*1024:
self.col.log("ignoring file over 100MB", f)
continue
# check encoding
if not isMac:
normf = unicodedata.normalize("NFC", f)