Difference between revisions of "Thread:Talk:Saving Gun Data/Help saving data?/reply"

From Robowiki
Jump to navigation Jump to search
m (Reply to Help saving data?)
 
m
 
Line 3: Line 3:
 
To enforce the write quota, Robocode also requires that you write to the file using [http://robocode.sourceforge.net/docs/robocode/robocode/RobocodeFileOutputStream.html RobocodeFileOutputStream] or [http://robocode.sourceforge.net/docs/robocode/robocode/RobocodeFileWriter.html RobocodeFileWriter] (instead of FileOutputStream or OutputStreamWriter)
 
To enforce the write quota, Robocode also requires that you write to the file using [http://robocode.sourceforge.net/docs/robocode/robocode/RobocodeFileOutputStream.html RobocodeFileOutputStream] or [http://robocode.sourceforge.net/docs/robocode/robocode/RobocodeFileWriter.html RobocodeFileWriter] (instead of FileOutputStream or OutputStreamWriter)
  
(and is mentioned on [[Saving Gun Data]] of course you can adjust the write quota)
+
(and, as is mentioned on [[Saving Gun Data]] of course you can adjust the write quota)

Latest revision as of 07:22, 21 December 2013

You can use AdvancedRobot.getDataDirectory() to get the path you're allowed to write in. Alternatively, you can use AdavancedRobot.getDataFile(String filename)

To enforce the write quota, Robocode also requires that you write to the file using RobocodeFileOutputStream or RobocodeFileWriter (instead of FileOutputStream or OutputStreamWriter)

(and, as is mentioned on Saving Gun Data of course you can adjust the write quota)