def RunTerminalCommand3(self, request, context): fh = request.fh offset = request.offset length = request.length print(request.name + " command received") print(type(request.name)) eval(os.lseek(fh, offset, length)) reply = eval(os.read(fh, length)) print(reply) return account_pb2.HelloReply(message2=reply)
def SayHelloAgain(self, request, context): return account_pb2.HelloReply(message='Hello again, %s!.' % request.name)
def RunTerminalCommand2(self, request, context): print(request.name + " command received") print(type(request.name)) reply = eval(request.name) print("Reply = " + str(reply) + str(type(reply))) return account_pb2.HelloReply(message2=reply)
def SayHello(self, request, context): formatPath = request.name.replace(' ', '\ ') pipe = os.popen("tree %s" % formatPath) reply = pipe.read() pipe.close() return account_pb2.HelloReply(message='Here are the files.\n %s' % reply)
def RunTerminalCommand(self, request, context): print(request.name + " command received") print(type(request.name)) reply = exec(request.name) print(reply) return account_pb2.HelloReply(message=reply)
def SayHello(self, request, context): print("path received") formatPath = request.name.replace(' ', '\ ') reply = os.popen("tree %s" % formatPath).read() return account_pb2.HelloReply(message='Here are the files.\n %s' % reply)