From f285fa37cc604bb808e4919307b86961ebd0a1f6 Mon Sep 17 00:00:00 2001 From: Mari Date: Sun, 18 Oct 2020 04:41:57 -0400 Subject: [PATCH] Make sure to create temporary files in the same directory as the result --- .../deliciousreya/minecraftportal/model/PortalDataStore.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/net/deliciousreya/minecraftportal/model/PortalDataStore.kt b/src/main/kotlin/net/deliciousreya/minecraftportal/model/PortalDataStore.kt index c90f344..f113086 100644 --- a/src/main/kotlin/net/deliciousreya/minecraftportal/model/PortalDataStore.kt +++ b/src/main/kotlin/net/deliciousreya/minecraftportal/model/PortalDataStore.kt @@ -158,8 +158,8 @@ class PortalDataStore (val logger: Logger) { fun onAfterChanged() { val destination = saveDataTo ?: return - logger.info("Saving updated data to $saveDataTo...") - val tempDestination = File.createTempFile("PortalSaveData", ".tmp.binproto") + logger.info("Saving updated data to $destination...") + val tempDestination = File.createTempFile(destination.nameWithoutExtension, ".tmp.binproto", destination.parentFile) val backupDestination = useBackup if (backupDestination != null && destination.exists()) { backupDestination.delete()