summaryrefslogtreecommitdiff
path: root/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'Utils')
-rw-r--r--Utils/FileUtils.swift18
-rw-r--r--Utils/PathUtils.swift13
2 files changed, 31 insertions, 0 deletions
diff --git a/Utils/FileUtils.swift b/Utils/FileUtils.swift
new file mode 100644
index 0000000..58e7124
--- /dev/null
+++ b/Utils/FileUtils.swift
@@ -0,0 +1,18 @@
+//
+// FileUtils.swift
+// PrySDR
+//
+// Created by Jacky Jack on 29/11/2024.
+//
+
+import Foundation
+
+func checkIfFileExists(_ fname: String) -> Bool {
+ let fm = FileManager.default
+ if fm.fileExists(atPath: fname) {
+ return true
+ }
+ return false
+}
+
+
diff --git a/Utils/PathUtils.swift b/Utils/PathUtils.swift
new file mode 100644
index 0000000..a82261a
--- /dev/null
+++ b/Utils/PathUtils.swift
@@ -0,0 +1,13 @@
+//
+// PathUtils.swift
+// PrySDR
+//
+// Created by Jacky Jack on 29/11/2024.
+//
+
+import Foundation
+
+//get current run directory
+func getCurrentExecutableDir() -> String {
+ return Process().currentDirectoryPath
+}