View unanswered posts | View active topics It is currently Wed Aug 20, 2014 1:18 am






Reply to topic  [ 4 posts ] 
Writing and Reading Files 
Author Message
Rookie

Joined: Wed Nov 09, 2011 6:10 pm
Posts: 4
Post 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
Profile
Rookie

Joined: Wed Nov 09, 2011 6:10 pm
Posts: 4
Post Re: Writing and Reading Files
bump


Mon Nov 14, 2011 5:59 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3187
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Nov 15, 2011 2:37 am
Profile WWW
Rookie

Joined: Wed Nov 09, 2011 6:10 pm
Posts: 4
Post Re: Writing and Reading Files
Awesome, thanks. I was looking for a sample program folder called IO. :P

Benton


Tue Nov 15, 2011 2:03 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.