From a95f7b04025179e0fbc15daa2d582cb2b5986ca7 Mon Sep 17 00:00:00 2001 From: Syer10 Date: Fri, 9 Jul 2021 22:04:02 -0400 Subject: [PATCH] Cleanup --- .../ca/gosyer/util/system/ProcessFile.kt | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 src/main/kotlin/ca/gosyer/util/system/ProcessFile.kt diff --git a/src/main/kotlin/ca/gosyer/util/system/ProcessFile.kt b/src/main/kotlin/ca/gosyer/util/system/ProcessFile.kt deleted file mode 100644 index 5449ee21..00000000 --- a/src/main/kotlin/ca/gosyer/util/system/ProcessFile.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ - -package ca.gosyer.util.system - -import ca.gosyer.BuildConfig -import java.io.File - -fun processFile() { - val pidFile = ProcessHandle.current().pid() - val strTmp = System.getProperty("java.io.tmpdir") - val file = File("$strTmp/${BuildConfig.NAME}.pid") - - // backup deletion - if (file.exists()) { - file.delete() - } - - file.writeText(pidFile.toString()) - - file.deleteOnExit() -}