Hey all,
As far as i know it is impossible to create an empty file with ftp, you have to create an empty file on the local drive, upload it, then delete it when you are done. I was wondering if it is possible to do something like:
class FakeFile:
def read(self):
return '\x04'
ftpinstance.storbinary('stor fe', FakeFile())
I thought this might work because the docs for storbinary say that it takes an object with a method 'read' and calls it til it returns EOF, and \x04 is the ASCII EOF character. I have tried this though, and the file ends up on the server being a random number of kilobytes large. Am I misunderstanding something?