@@ -306,6 +306,37 @@ mutable class Context{
306
306
}
307
307
}
308
308
309
+ readonly fun mclone(): mutable this {
310
+ mutable static{
311
+ pwd => this.pwd,
312
+ dirs => this.dirs,
313
+ reads => this.reads,
314
+ time => this.time,
315
+ tick => this.tick,
316
+ lazyCapacity => this.lazyCapacity,
317
+ toUpdate => this.toUpdate,
318
+ deps => this.deps,
319
+ debugMode => this.debugMode,
320
+ failOnExn => this.failOnExn,
321
+ hasPre => this.hasPre,
322
+ newDirs => this.newDirs,
323
+ toReset => this.toReset,
324
+ globals => this.globals,
325
+ asyncList => this.asyncList,
326
+ dirty => this.dirty,
327
+ dirtyReaders => this.dirtyReaders,
328
+ unsafeReuse => this.unsafeReuse,
329
+ arrowStack => this.arrowStack,
330
+ lazyGets => this.lazyGets,
331
+ lazyGetsQueueIn => this.lazyGetsQueueIn,
332
+ lazyGetsQueueOut => this.lazyGetsQueueOut,
333
+ lazyGetsRefCount => this.lazyGetsRefCount,
334
+ reallyRemoveDir => this.reallyRemoveDir,
335
+ sessions => this.sessions,
336
+ removeSubDirs => this.removeSubDirs,
337
+ }
338
+ }
339
+
309
340
static fun fromSaved(ctx: Context): mutable this {
310
341
mutable static{
311
342
pwd => ctx.pwd,
@@ -446,6 +477,7 @@ mutable class Context{
446
477
totalSize => 0,
447
478
fixedData => FixedDir::create(),
448
479
creator => this.currentArrow(),
480
+ reallyRemove => dir.reallyRemove,
449
481
};
450
482
dir.unsafeIterKeys((key, _time) -> {
451
483
values = dir.getArrayRaw(key).collect(Array);
@@ -651,10 +683,12 @@ mutable class Context{
651
683
mutable fun mkdir<T: File>(
652
684
conv: File ~> T,
653
685
dirName: DirName,
686
+ reallyRemove: Bool,
654
687
content: Array<(BaseName, T)> = Array[],
655
688
): EHandle<T> {
656
689
this.mkdirMulti(
657
690
dirName,
691
+ reallyRemove,
658
692
content.map(kv -> {
659
693
(key, value) = kv;
660
694
(key, Array[value])
@@ -665,6 +699,7 @@ mutable class Context{
665
699
666
700
mutable fun mkdirMulti(
667
701
dirName: DirName,
702
+ reallyRemove: Bool,
668
703
content: Array<(BaseName, Array<File>)> = Array[],
669
704
): void {
670
705
if (this.dirs.state.containsKey(dirName)) {
@@ -706,7 +741,15 @@ mutable class Context{
706
741
707
742
totalSize = fixedData.data.size();
708
743
creator = this.currentArrow();
709
- dir = EagerDir{time, input => true, dirName, fixedData, totalSize, creator};
744
+ dir = EagerDir{
745
+ time,
746
+ input => true,
747
+ dirName,
748
+ fixedData,
749
+ totalSize,
750
+ creator,
751
+ reallyRemove,
752
+ };
710
753
this.setDir(dirName, dir);
711
754
this.!newDirs = this.newDirs.add(dirName);
712
755
}
@@ -716,6 +759,7 @@ mutable class Context{
716
759
dirName: DirName,
717
760
content: Array<Row>,
718
761
decompress: Row ~> FixedRow<Array<File>>,
762
+ reallyRemove: Bool,
719
763
): EHandle<T> {
720
764
if (this.dirs.state.containsKey(dirName)) {
721
765
throw DirAlreadyExists(dirName);
@@ -726,7 +770,15 @@ mutable class Context{
726
770
727
771
totalSize = fixedData.data.size();
728
772
creator = this.currentArrow();
729
- dir = EagerDir{time, input => true, dirName, fixedData, totalSize, creator};
773
+ dir = EagerDir{
774
+ time,
775
+ input => true,
776
+ dirName,
777
+ fixedData,
778
+ totalSize,
779
+ creator,
780
+ reallyRemove,
781
+ };
730
782
this.setDir(dirName, dir);
731
783
this.!newDirs = this.newDirs.add(dirName);
732
784
EHandle(conv, dirName)
@@ -953,7 +1005,7 @@ fun resolveContext(
953
1005
| Some(x) -> SKFS.IntFile::fromFile(x).value
954
1006
};
955
1007
print_error("Error, line " + line + ": " + err.getMessage());
956
- exit (2);
1008
+ skipExit (2);
957
1009
}),
958
1010
)
959
1011
};
0 commit comments