adds error message for file-not-found on |cp, |mv, and |rm

also adds an error message for mark changes
This commit is contained in:
Joseph Bryan 2016-07-15 21:56:50 -04:00
parent 3a4441ce57
commit 97a8aac322
4 changed files with 37 additions and 8 deletions

View File

@ -136,6 +136,8 @@
++ 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,6 +4,4 @@
/? 310
:- %say
|= {^ {input/path output/path $~} $~}
:+ %kiln-info "copied"
?> =(-:(flop input) -:(flop output))
(foal output -:(flop input) [%atom %t ~] .^(* %cx input)) :: XX type
[%kiln-cp input output]

View File

@ -4,7 +4,4 @@
/? 310
:- %say
|= {^ {input/path output/path $~} $~}
:+ %kiln-info "moved"
?> =(-:(flop input) -:(flop output))
%+ furl (fray input)
(foal output -:(flop input) [%noun .^(* %cx input)])
[%kiln-mv input output]

View File

@ -157,7 +157,39 @@
|= {mez/tape tor/toro}
abet:(emit:(spam leaf+mez ~) %info /kiln our tor)
::
++ poke-rm |=(a/path (poke-info "removed" (fray a)))
++ 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)
?~ fil.b
=+ ~[leaf+"No such file:" leaf+"{<a>}"]
abet:(spam -)
(poke-info "removed" (fray a))
::
++ poke-label
|= {syd/desk lab/@tas}
=+ pax=/(scot %p our)/[syd]/[lab]