Reading contents of a file through script

General discussion about the R.U.B.E editor
Post Reply
b2d_beginner
Posts: 2
Joined: Mon Jul 15, 2013 8:57 am

Reading contents of a file through script

Post 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.
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Reading contents of a file through script

Post 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.
b2d_beginner
Posts: 2
Joined: Mon Jul 15, 2013 8:57 am

Re: Reading contents of a file through script

Post by b2d_beginner »

Hey... thanks

Looking forward to it 8-)
Post Reply