I wrote a function append_line() in ftplib (based on storelines()):
def append_line(self, cmd, string):
self.voidcmd('TYPE A')
conn = self.transfercmd(cmd)
conn.sendall(string)
conn.close()
return self.voidresp()
When I call:
ftp.append_line("APPE " + "Text.dat", "This is my string\n\n")
it will append the string to the mentioned file, but ignores the newline. So, socket.sendall is ignoring the character \n.
How can I properly update the file with a newline character?
It looks like you have a different problem. When I try to sendall with your string, it appears to work:
Client code:
Server code: