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

Information about the services, News, Discussions, Issues and requests for installing packages etc.

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

Postby FrenchDeathxxl » September 15th, 2013, 6:49 pm

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
User avatar
FrenchDeathxxl
Member
 
Posts: 15
Joined: June 1st, 2013, 2:02 pm

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

Postby NullByte » September 16th, 2013, 5:47 am

Did you check the permissions?
NULL
User avatar
NullByte
Fewona Staff
 
Posts: 1011
Joined: July 4th, 2012, 2:50 pm
Location: /dev/null

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

Postby FrenchDeathxxl » September 16th, 2013, 7:46 pm

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.
User avatar
FrenchDeathxxl
Member
 
Posts: 15
Joined: June 1st, 2013, 2:02 pm

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

Postby NullByte » September 20th, 2013, 7:36 am

What's the exact error message?
NULL
User avatar
NullByte
Fewona Staff
 
Posts: 1011
Joined: July 4th, 2012, 2:50 pm
Location: /dev/null

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

Postby FrenchDeathxxl » September 21st, 2013, 7:59 am

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.
User avatar
FrenchDeathxxl
Member
 
Posts: 15
Joined: June 1st, 2013, 2:02 pm

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

Postby NullByte » September 21st, 2013, 8:13 am

You don't disturb anyone :) I'm glad you fixed it.
NULL
User avatar
NullByte
Fewona Staff
 
Posts: 1011
Joined: July 4th, 2012, 2:50 pm
Location: /dev/null


Return to Info, News, Discussions and Problems

Who is online

Users browsing this forum: No registered users and 1 guest