def do_cp(self, command):
        """cp <ri> <rf> <wi> <wn>: copy file 'rf' from 'ri' to file 'wf' on 'wi'."""
        args = shlex.split(command)
        if len(args) != 4:
            self.stdout.write(Text("Error: invalid argument count!\n", "red"))
            return
        rfi, rfp, wfi, wfp = args
        if wfi == rfi:
            self.stdout.write(Text("Error: can only copy between different interfaces!", "red"))
        if (rfi not in self.FSIs) or (wfi not in self.FSIs):
            self.stdout.write(Text("Error: Interface not found!\n", "red"))
            return
        rfsi = self.FSIs[rfi]
        wfsi = self.FSIs[wfi]
        isfile = rfsi.isfile(rfp)
        isdir = rfsi.isdir(rfp)
        if isfile:
            self.stdout.write("Copying file '{n}'...\n".format(n=rfp))
            try:
                self.stdout.write("   Opening infile... ")
                rf = rfsi.open(rfp, "rb")
                self.stdout.write(Text("Done", "green"))
                self.stdout.write(".\n   Opening outfile... ")
                wf = wfsi.open(wfp, "wb")
                self.stdout.write(Text("Done", "green"))
                self.stdout.write(".\n   Copying... ")
                while True:
                    data = rf.read(4096)
                    if len(data) == 0:
                        break
                    wf.write(data)
                self.stdout.write(Text("Done", "green"))
                self.stdout.write(".\n")
            except IsDir:
                self.stdout.write(Text("Error: expected a filepath!\n", "red"))
                return
            except OperationFailure as e:
                self.stdout.write(Text("Error: {m}!\n".format(m=e.message), "red"))
                return
            finally:
                self.stdout.write("   Closing infile... ")
                try:
                    rf.close()
                    self.stdout.write(Text("Done", "green"))
                    self.stdout.write(".\n")
                except Exception as e:
                    self.stdout.write(Text("Error: {m}!\n".format(m=e.message), "red"))
                self.stdout.write("   Closing outfile... ")
                try:
                    wf.close()
                    self.stdout.write(Text("Done", "green"))
                    self.stdout.write(".\n")
                except Exception as e:
                    self.stdout.write(Text("Error: {m}!\n".format(m=e.message), "red"))
                self.stdout.write(Text("Done", "green"))
                self.stdout.write(".\n")
        elif isdir:
            crp = rfsi.get_path()
            cwp = wfsi.get_path()
            rfsi.cd(rfp)
            if not (wfp in wfsi.listdir() or wfp == "/"):
                self.stdout.write("Creating dir '{n}'... ".format(n=wfp))
                try:
                    wfsi.mkdir(wfp)
                except AlreadyExists as e:
                    pass
                self.stdout.write(Text("Done", "green"))
                self.stdout.write(".\n")
            wfsi.cd(wfp)
            try:
                content = rfsi.listdir()
                for fn in content:
                    subcommand = '{rfi} "{name}" {wfi} "{name}"'.format(rfi=rfi, name=fn, wfi=wfi)
                    self.do_cp(subcommand)
            except OperationFailure as e:
                self.stdout.write(Text("Error: {e}!\n".format(e=e.message), "red"))
                return
            finally:
                rfsi.cd(crp)
                wfsi.cd(cwp)
        else:
            self.stdout.write(Text("Error: Not found!\n", "red"))
            return
cp <ri> <rf> <wi> <wn>: copy file 'rf' from 'ri' to file 'wf' on 'wi'.
bin/mc.py