Page 1 of 1

Reading contents of a file through script

Posted: Mon Jul 15, 2013 9:20 am
by b2d_beginner
Hi,

Before i started using RUBE, i was using my own editor that used to export physics data in to the text file.

Now i want to import text file data through script. I found that AngelScript has support of file class as an addon.

But i don't know how to use it. If i can read text file data, it will save lot of time.

Any Suggestions.

Re: Reading contents of a file through script

Posted: Mon Jul 15, 2013 2:11 pm
by iforce2d
The next update will add these script functions which you will probably find useful:

bool dirExists(string path)
bool fileExists(string path)
string readFile(string file)
bool writeFile(string file, string text)

It should be ready in the next few days.

Re: Reading contents of a file through script

Posted: Tue Jul 16, 2013 7:19 am
by b2d_beginner
Hey... thanks

Looking forward to it 8-)