mirror of
https://github.com/ciromattia/kcc
synced 2025-12-23 22:51:45 +00:00
only flatten super long paths on Windows
This commit is contained in:
@@ -1052,8 +1052,8 @@ def chunk_directory(path):
|
|||||||
level = -1
|
level = -1
|
||||||
for root, _, files in os.walk(os.path.join(path, 'OEBPS', 'Images')):
|
for root, _, files in os.walk(os.path.join(path, 'OEBPS', 'Images')):
|
||||||
for f in files:
|
for f in files:
|
||||||
# Windows MAX_LENGTH = 260 plus some buffer
|
# Windows MAX_LEN = 260 plus some buffer
|
||||||
if len(os.path.join(root, f)) > 180:
|
if os.name == 'nt' and len(os.path.join(root, f)) > 180:
|
||||||
flattenTree(os.path.join(path, 'OEBPS', 'Images'))
|
flattenTree(os.path.join(path, 'OEBPS', 'Images'))
|
||||||
level = 1
|
level = 1
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user