Page 1 of 1

Problem : my python bot can't write in a file

PostPosted: September 15th, 2013, 6:49 pm
by FrenchDeathxxl
Hi,

My python bot have to write in a file, on my computer the bot can write in the file, but on the server it doesn't work.

Must bot have right to write in a file ?

This is the commande I use for that the bot write in a file, is it a wrong command for a python bot who is on a server ?
(the file Recuperation.txt is in the same folder that the python bot, and as I already said, it works when the bot and the file is used on my computer)

Code: Select all
recuperation = open("Recuperation.txt", "w")
recuperation.write(str(liste) + "  " +str(liste2) + " " + str(liste_temps))
recuperation.close()



Username : frenchdeathxxl
Server : Epsilon

Re: Problem : my python bot can't write in a file

PostPosted: September 16th, 2013, 5:47 am
by NullByte
Did you check the permissions?

Re: Problem : my python bot can't write in a file

PostPosted: September 16th, 2013, 7:46 pm
by FrenchDeathxxl
For the permissions, everybody can execute and write in my file "Recuperation.txt" The file has the access rights : rwxrwxrwx but it doesn't work, my bot can't write in the file.

Re: Problem : my python bot can't write in a file

PostPosted: September 20th, 2013, 7:36 am
by NullByte
What's the exact error message?

[Solved]Problem : my python bot can't write in a file

PostPosted: September 21st, 2013, 7:59 am
by FrenchDeathxxl
Problem solved

I put the whole directory, and now it works

Code: Select all
recuperation = open("/home/frenchdeathxxl/Bot-irc/Recuperation.txt", "w")
recuperation.write(str(liste) + "  " +str(liste2) + " " + str(liste_temps))
recuperation.close()


Sorry for the disturbance.

Re: Problem : my python bot can't write in a file

PostPosted: September 21st, 2013, 8:13 am
by NullByte
You don't disturb anyone :) I'm glad you fixed it.