moves |cp and |mv implementations back into the generators

This commit is contained in:
Joseph Bryan 2016-07-16 00:19:49 -04:00
parent 97a8aac322
commit c800b7f489
4 changed files with 21 additions and 29 deletions

View File

@ -136,8 +136,6 @@
++ poke-kiln-merge (wrap poke-merge):from-kiln
++ poke-kiln-cancel (wrap poke-cancel):from-kiln
++ poke-kiln-mount (wrap poke-mount):from-kiln
++ poke-kiln-cp (wrap poke-cp):from-kiln
++ poke-kiln-mv (wrap poke-mv):from-kiln
++ poke-kiln-rm (wrap poke-rm):from-kiln
++ poke-kiln-schedule (wrap poke-schedule):from-kiln
++ poke-kiln-track (wrap poke-track):from-kiln

View File

@ -4,4 +4,13 @@
/? 310
:- %say
|= {^ {input/path output/path $~} $~}
[%kiln-cp input output]
?. =(-:(flop input) -:(flop output))
~& "Can't move to a different mark"
~
=+ dir=.^(arch %cy input)
?~ fil.dir
~& "No such file:"
~& <input>
~
:+ %kiln-info "copied"
(foal output -:(flop input) [%atom %t ~] .^(* %cx input)) :: XX type

View File

@ -4,4 +4,14 @@
/? 310
:- %say
|= {^ {input/path output/path $~} $~}
[%kiln-mv input output]
?. =(-:(flop input) -:(flop output))
~& "Can't move to a different mark"
~
=+ dir=.^(arch %cy input)
?~ fil.dir
~& "No such file:"
~& <input>
~
:+ %kiln-info "moved"
%+ furl (fray input)
(foal output -:(flop input) [%noun .^(* %cx input)])

View File

@ -157,31 +157,6 @@
|= {mez/tape tor/toro}
abet:(emit:(spam leaf+mez ~) %info /kiln our tor)
::
++ poke-cp
|= {a/path b/path}
?. =(-:(flop a) -:(flop b))
=+ ~[leaf+"Can't copy to a different mark"]
abet:(spam -)
=+ c=.^(arch %cy a)
?~ fil.c
=+ ~[leaf+"No such file:" leaf+"{<a>}"]
abet:(spam -)
%+ poke-info "copied"
(foal b -:(flop a) [%atom %t ~] .^(* %cx a)) :: XX type
::
++ poke-mv
|= {a/path b/path}
?. =(-:(flop a) -:(flop b))
=+ ~[leaf+"Can't move to a different mark"]
abet:(spam -)
=+ c=.^(arch %cy a)
?~ fil.c
=+ ~[leaf+"No such file:" leaf+"{<a>}"]
abet:(spam -)
%+ poke-info "moved"
%+ furl (fray a)
(foal b -:(flop a) [%noun .^(* %cx a)])
::
++ poke-rm
|= a/path
=+ b=.^(arch %cy a)