aboutsummaryrefslogtreecommitdiffhomepage
path: root/system/link.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-03 02:26:14 +0900
committerOphestra <cat@gensokyo.uk>2025-10-03 02:26:14 +0900
commitd16da6da8c4880d90dc35fa9006806f7c0395d7f (patch)
treed4ca8fed4e14bcffe63268daa6d8efd1923ff03b /system/link.go
parente58181a930064385c881b7ee1cac4914dd435121 (diff)
system: enforce absolute paths
This is less error-prone, and is quite easy to integrate considering internal/app has already migrated to container.Absolute. Closes #11. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system/link.go')
-rw-r--r--system/link.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/system/link.go b/system/link.go
index 50a05348..dcd742c2 100644
--- a/system/link.go
+++ b/system/link.go
@@ -3,15 +3,18 @@ package system
import (
"fmt"
+ "hakurei.app/container"
"hakurei.app/hst"
)
// Link calls LinkFileType with the [Process] criteria.
-func (sys *I) Link(oldname, newname string) *I { return sys.LinkFileType(Process, oldname, newname) }
+func (sys *I) Link(oldname, newname *container.Absolute) *I {
+ return sys.LinkFileType(Process, oldname, newname)
+}
// LinkFileType maintains a hardlink until its [Enablement] is no longer satisfied.
-func (sys *I) LinkFileType(et hst.Enablement, oldname, newname string) *I {
- sys.ops = append(sys.ops, &hardlinkOp{et, newname, oldname})
+func (sys *I) LinkFileType(et hst.Enablement, oldname, newname *container.Absolute) *I {
+ sys.ops = append(sys.ops, &hardlinkOp{et, newname.String(), oldname.String()})
return sys
}