I have some file remotely :
___________
[somevar]
Test: 2
___________
And i want to change var "Test" to 3 for example so i will have :
___________
[somevar]
Test: 3
___________
I'm using this function to upload file
ftp = ftplib.FTP('')
ftp.connect(HOSTNAME,PORT)
ftp.login(FTP_NAME,FTP_PASS)
file = open(PATH + FILENAME, 'rb')
ftp.storbinary('STOR '+FILENAME, file)
file.close()
ftp.quit()
I know I can download the file, change it localy then upload it again But i'm searching for a remotely solution
Do you think this could be done ?
Can i do this via IOString :
Here is my code, unfortunately this doesn't work :(
# Writing to a buffer
ChangeVar = StringIO("[Somevar] \nTest: 3")
ftp = ftplib.FTP('')
ftp.connect(HOSTNAME,FTP_PORT)
ftp.login(FTP_NAME,FTP_PASS)
ftp.storbinary('STOR '+Myvarfile, switchVar)
#Disconnect
ftp.quit()