Stefan Oltmann
05/01/2024, 5:14 AMprivate fun ensureSingleInstance(): Boolean {
val lockFile = File(System.getenv("TEMP") + "/ashampoo-photo-organizer.lock")
val channel = RandomAccessFile(lockFile, "rw").channel
fileLock = channel.tryLock()
return fileLock != null
}
Marcin Wisniowski
05/01/2024, 1:24 PMStefan Oltmann
05/01/2024, 2:50 PMMarcin Wisniowski
05/01/2024, 3:13 PMStefan Oltmann
05/01/2024, 4:07 PMStefan Oltmann
05/01/2024, 4:08 PMMarcin Wisniowski
05/01/2024, 4:14 PMthat’s still prone to I/O errors.I didn't see any issues. Maybe the TEMP directory is the culprit? I keep my file APPDATA.
Marcin Wisniowski
05/01/2024, 4:15 PMephemient
05/01/2024, 6:31 PMMarcin Wisniowski
05/01/2024, 6:35 PMephemient
05/01/2024, 6:37 PMMarcin Wisniowski
05/01/2024, 6:43 PMephemient
05/01/2024, 7:59 PMMarcin Wisniowski
05/01/2024, 8:36 PMStefan Oltmann
05/02/2024, 4:17 AMStefan Oltmann
05/02/2024, 4:22 AMIf your program is unable to create/write to a file then that seems like an issue in itself. Since it won't be able to save anything, or remember settings, or do any other basic things.I don’t know what’s up with the users systems, but a few have strange I/O errors sometimes. Rare, but happens. Normally that’s no a big deal as a missing image file will be skipped and read on the next attempt/sync again. Just not starting at all has bigger significance.
mikehearn
05/02/2024, 7:45 AMStefan Oltmann
05/02/2024, 8:05 AMephemient
05/02/2024, 1:57 PMStefan Oltmann
05/02/2024, 2:01 PMStefan Oltmann
05/02/2024, 2:02 PM