From e80487e3795ea9eaf30790228600a90a9444d818 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Sat, 13 Sep 2025 18:30:03 +0800 Subject: [PATCH] Work around filename length limit on some devices --- app/src/main/kotlin/com/hippo/ehviewer/util/FileUtils.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/hippo/ehviewer/util/FileUtils.kt b/app/src/main/kotlin/com/hippo/ehviewer/util/FileUtils.kt index 494fbec5a..6fc9012cd 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/util/FileUtils.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/util/FileUtils.kt @@ -23,9 +23,9 @@ import java.io.File import okio.Path object FileUtils { - // Even though vfat allows 255 UCS-2 chars, we might eventually write to - // ext4 through a FUSE layer, so use that limit. - private const val MAX_FILENAME_BYTES = 255 + // Workaround for filename length limit on some devices + // https://github.com/FooIbar/EhViewer/issues/2607 + private const val MAX_FILENAME_BYTES = 200 fun ensureDirectory(file: File?) = file?.let { if (it.exists()) it.isDirectory else it.mkdirs() } == true