aboutsummaryrefslogtreecommitdiff
path: root/internal/utils
diff options
context:
space:
mode:
authorishaan <contact@ishaan.cc>2026-07-15 06:40:02 +0530
committerishaan <contact@ishaan.cc>2026-07-15 06:40:02 +0530
commitaed1dd45b71d061848e52fbf1b36dd09a52e0021 (patch)
tree3a807be47b77bc8331b6754d0cd6659e4474fdfb /internal/utils
parent2cc09ca2977cafc9da939907b9088dcfba14e685 (diff)
use tmpfs instead of tmp dir
Diffstat (limited to 'internal/utils')
-rw-r--r--internal/utils/utils.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/utils/utils.go b/internal/utils/utils.go
index cea00a3..f620af3 100644
--- a/internal/utils/utils.go
+++ b/internal/utils/utils.go
@@ -66,6 +66,13 @@ func RandomLettersNumbers(n int) []byte {
return b
}
+func SecureTempDir() string {
+ if _, err := os.Stat("/dev/shm"); err == nil {
+ return "/dev/shm"
+ }
+ return ""
+}
+
func CheckFileAuthMode(notePath string) (crypt.AuthMode, error) {
data, err := os.ReadFile(notePath)
if err != nil {