Why I didn't write data to txt file

Typically: "How do I... ", "How can I... " questions
Post Reply
Encourage
Posts: 4
Joined: 15 Dec 2014, 01:50

Why I didn't write data to txt file

Post by Encourage »

Hi coppelia,
I want to use some commands to write a string or some data to txt file in v-rep,but it doesn't work.
i used similar commands ,such as,
name="fileHandle.txt"
file=io.open(name,"w")
file:write("hello world")
file:close()
when the simulation ended,the txt file has none, I want to know whether it needs head files like c/c++ language.
Besides, can you tell me some other methods to realize this problem.
Best wishes
xiao ming

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Why I didn't write data to txt file

Post by coppelia »

Hello Xiao Ming,

does the file exist? Make sure to specify the correct path. By default, if you do not specify the path, but just the filename, the file will be created in the V-REP directory.

Cheers

Post Reply