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.)




// move file
local(f = file('input.txt'))
#f->moveTo('output.txt')
#f->close
 
// move directory, just like a file
local(d = dir('docs'))
#d->moveTo('mydocs')
 
// move file in root file system (requires permissions at user OS level)
local(f = file('//input.txt'))
#f->moveTo('//output.txt')
#f->close
 
// move directory in root file system (requires permissions at user OS level)
local(d = file('//docs'))
#d->moveTo('//mydocs')