Aug-02-2020, 02:39 PM
(This post was last modified: Aug-02-2020, 02:40 PM by therenaydin.)
I'm trying to create a register system based on server. Sending directories to my server with their name. But if you try to register with an existing username, you can. I don't want that... Tried that before in my own computer with os.mkdir() and worked perfectly. But when i remote control my server and use mkdir that just overwrites the old one. How can i fix that? Here is my code;
try: stdin, stdout, stderr = ssh.exec_command('cd Server_Data;cd Users;mkdir '+userName) except: print("There is a registered user with the same name. Please choose another one.") else: savedUser = userName stdin, stdout, stderr = ssh.exec_command('cd Server_Data;cd Users;cd '+userName+';echo ' + userName + ' > rUser.txt') savedPass = password stdin, stdout, stderr = ssh.exec_command('cd Server_Data;cd Users;cd '+userName+';echo ' + password + ' > rPassw.txt')