Task

Rename:

   a file called     input.txt     into     output.txt     and 
   a directory called     docs     into     mydocs.


This should be done twice:  
once "here", i.e. in the current working directory and once in the filesystem root.

It can be assumed that the user has the rights to do so.

(In unix-type systems, only the user root would have
sufficient permissions in the filesystem root.)




frename=: 4 : 0
 if. x -: y do. return. end.
 if. IFUNIX do.
   hostcmd=. [: 2!:0 '('"_ , ] , ' || true)'"_
   hostcmd 'mv "',y,'" "',x,'"'
 else.
   'kernel32 MoveFileA i *c *c' 15!:0 y;x
 end.
)