From: Jeff E. <jem...@fr...> - 2008-01-17 19:06:30
|
This works pretty fast, but it fills the file with zeros, not text. >>> import java >>> raf=java.io.RandomAccessFile("path_to_file","rw") >>> raf.setLength(1024*1024*10) >>> raf.close() Jesse Millan wrote: > All, > > I'm looking for an efficient way to create a large dummy file in > jython. It'll need to be created and filled with about 10 MB of > (arbitrary - preferably text) data all at once. Obviously using a for > loop and calling PyFile.write("a") ten million times is a bad idea > memory wise... any suggestions? > > Thanks! > > -Jesse > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |