From 7ee2c44c6a182e08bf2d5fc0bb88d8bfda4baa02 Mon Sep 17 00:00:00 2001 From: Eric Helgeson Date: Mon, 21 Nov 2022 09:37:58 -0600 Subject: [PATCH] Warn user if file is fragmented See: https://github.com/greiman/SdFat/issues/256#issuecomment-778795554 - performance can be impacted if the file is fragmented on the SD card. --- src/BlueSCSI.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/BlueSCSI.cpp b/src/BlueSCSI.cpp index 579fab4..922e356 100644 --- a/src/BlueSCSI.cpp +++ b/src/BlueSCSI.cpp @@ -231,6 +231,10 @@ bool hddimageOpen(SCSI_DEVICE *dev, FsFile *file,int id,int lun,int blocksize) LOG_FILE.println(" - file is 0 bytes, can not use."); goto failed; } + if(!dev->m_file->isContiguous()) + { + LOG_FILE.println(" - file is fragmented, see https://github.com/erichelgeson/BlueSCSI/wiki/Image-File-Fragmentation"); + } if(dev->m_type == SCSI_DEVICE_OPTICAL) { LOG_FILE.print(" CDROM");