aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/world/file.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/world/file.lux30
1 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/source/library/lux/world/file.lux b/stdlib/source/library/lux/world/file.lux
index 293856d25..e6c10352f 100644
--- a/stdlib/source/library/lux/world/file.lux
+++ b/stdlib/source/library/lux/world/file.lux
@@ -88,8 +88,8 @@
(#.Some last_separator)
(do maybe.monad
- [[parent temp] (text.split last_separator path)
- [_ child] (text.split (text.size /) temp)]
+ [[parent temp] (text.split_at last_separator path)
+ [_ child] (text.split_at (text.size /) temp)]
(in [parent child])))))
(def: .public (parent fs path)
@@ -1193,13 +1193,13 @@
(|>> (<retrieve> separator path)
(try\map (function.constant true))
(try.else false)))
- stm.commit))]
+ stm.commit!))]
[file? ..retrieve_mock_file!]
[directory? ..retrieve_mock_directory!]))
(def: (make_directory path)
- (stm.commit
+ (stm.commit!
(do {! stm.monad}
[|store| (stm.read store)]
(case (..make_mock_directory! separator path |store|)
@@ -1213,7 +1213,7 @@
(~~ (template [<method> <tag>]
[(def: (<method> path)
- (stm.commit
+ (stm.commit!
(do stm.monad
[|store| (stm.read store)]
(in (do try.monad
@@ -1233,7 +1233,7 @@
))
(def: (file_size path)
- (stm.commit
+ (stm.commit!
(do stm.monad
[|store| (stm.read store)]
(in (|> |store|
@@ -1243,7 +1243,7 @@
binary.size)))))))
(def: (last_modified path)
- (stm.commit
+ (stm.commit!
(do stm.monad
[|store| (stm.read store)]
(in (|> |store|
@@ -1252,7 +1252,7 @@
(get@ #mock_last_modified))))))))
(def: (can_execute? path)
- (stm.commit
+ (stm.commit!
(do stm.monad
[|store| (stm.read store)]
(in (|> |store|
@@ -1261,7 +1261,7 @@
(get@ #mock_can_execute))))))))
(def: (read path)
- (stm.commit
+ (stm.commit!
(do stm.monad
[|store| (stm.read store)]
(in (|> |store|
@@ -1270,11 +1270,11 @@
(get@ #mock_content))))))))
(def: (delete path)
- (stm.commit
+ (stm.commit!
(..attempt! (..delete_mock_node! separator path) store)))
(def: (modify now path)
- (stm.commit
+ (stm.commit!
(..attempt! (function (_ |store|)
(do try.monad
[[name file] (..retrieve_mock_file! separator path |store|)]
@@ -1284,13 +1284,13 @@
(def: (write content path)
(do async.monad
[now (async.future instant.now)]
- (stm.commit
+ (stm.commit!
(..attempt! (..update_mock_file! separator path now content) store))))
(def: (append content path)
(do async.monad
[now (async.future instant.now)]
- (stm.commit
+ (stm.commit!
(..attempt! (function (_ |store|)
(do try.monad
[[name file] (..retrieve_mock_file! separator path |store|)]
@@ -1302,7 +1302,7 @@
store))))
(def: (move destination origin)
- (stm.commit
+ (stm.commit!
(do {! stm.monad}
[|store| (stm.read store)]
(case (do try.monad
@@ -1333,7 +1333,7 @@
(let [rooted? (text.starts_with? (\ fs separator) path)
segments (text.all_split_by (\ fs separator) path)]
(case (if rooted?
- (list.drop 1 segments)
+ (list.after 1 segments)
segments)
#.End
(\ monad in (exception.except ..cannot_make_directory [path]))