'Returns the current remote directory.
@return: a L{Deferred} that will be called back with a C{str} giving
the remote directory or which will errback with L{CommandFailed}
if an error response is returned.'

def getDirectory(self):

    def cbParse(result):
        try:
            if (int(result[0].split('    ', 1)[0]) != 257):
                raise ValueError
        except (IndexError, ValueError):
            return failure.Failure(CommandFailed(result))
        path = parsePWDResponse(result[0])
        if (path is None):
            return failure.Failure(CommandFailed(result))
        return path
    return self.pwd().addCallback(cbParse)
