|
Page 1 of 1
|
[ 4 posts ] |
|
Writing and Reading Files
| Author |
Message |
|
Benton
Rookie
Joined: Wed Nov 09, 2011 6:10 pm Posts: 4
|
 Writing and Reading Files
Hey everyone,
I am currently creating a program that writes variables to a file, so they can be used by other programs on the brick. This is the the part that has me stumped. I have no clue how to create, write, and read files. I need to know how to create a file if it does not already exist, write to certain lines, and then save it. Then, I need to know how to open it, read it, and copy certain lines from the file into variables.
Many Thanks, Benton
|
| Thu Nov 10, 2011 2:56 am |
|
 |
|
Benton
Rookie
Joined: Wed Nov 09, 2011 6:10 pm Posts: 4
|
 Re: Writing and Reading Files
bump
|
| Mon Nov 14, 2011 5:59 pm |
|
 |
|
mightor
Moderator
Joined: Wed Mar 05, 2008 8:14 am Posts: 2864 Location: Rotterdam, The Netherlands
|
 Re: Writing and Reading Files
Did you check the Samples directory? There's an "Nxt File IO Test.c" under the "NXT Feature Samples". There may be others there as well. Go to "File->Open Sample Program" and start browsing around  - Xander
_________________| Some people, when confronted with a problem, think, "I know, I'll use threads," | and then two they hav erpoblesms. (@nedbat)| My Blog: I'd Rather Be Building Robots| ROBOTC 3rd Party Driver Suite: [ Project Page]
|
| Tue Nov 15, 2011 2:37 am |
|
 |
|
Benton
Rookie
Joined: Wed Nov 09, 2011 6:10 pm Posts: 4
|
 Re: Writing and Reading Files
Awesome, thanks. I was looking for a sample program folder called IO.  Benton
|
| Tue Nov 15, 2011 2:03 pm |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 5 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|