summaryrefslogtreecommitdiff
path: root/lib/fileutil/loopcheck+plan9.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-09-13 15:04:40 -0700
committerOri Bernstein <ori@mmarkovcorp.com>2017-09-13 15:04:40 -0700
commit943c865bcfacb00af4c681fc36fbcab2b7f9a55f (patch)
treecf56947f5cad8e3c5197499d4943295c1f1a3e0a /lib/fileutil/loopcheck+plan9.myr
parent1f4389df622ed274371d0c134ffd3b1c5a94bd48 (diff)
downloadmc-943c865bcfacb00af4c681fc36fbcab2b7f9a55f.tar.gz
Add loop checking to libfileutil.
Diffstat (limited to 'lib/fileutil/loopcheck+plan9.myr')
-rw-r--r--lib/fileutil/loopcheck+plan9.myr21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/fileutil/loopcheck+plan9.myr b/lib/fileutil/loopcheck+plan9.myr
new file mode 100644
index 0000000..64bc79f
--- /dev/null
+++ b/lib/fileutil/loopcheck+plan9.myr
@@ -0,0 +1,21 @@
+use std
+
+/* plan 9 can't have directory loops, by construction, so this is nops */
+pkg fileutil =
+ type loopcheck = void
+
+ const mkloopcheck : (cwd : byte[:] -> loopcheck)
+ const freeloopcheck : (l : loopcheck -> void)
+ const looped : (l : loopcheck, p : byte[:] -> bool)
+;;
+
+const mkloopcheck = {cwd
+ -> (void : loopcheck)
+}
+
+const freeloopcheck = {l, l
+}
+
+const looped = {p
+ -> false
+}