There is an incredibly arcane sequence of stream creations
that Java makes you jump through to do the equivalent of
fopen() and fprintf(). I have to re-find the last piece of
code that I wrote and copy it every time I need it.
OK I found it (again):

  PrintStream out =
    new PrintStream(
        new BufferedOutputStream(
         new FileOutputStream( new File( "file.txt" ) )), false );

  out.println( "whew" );

At least readline() type input is a bit easier:

  BufferedReader in =
        new BufferedReader( new FileReader( "file.txt" ) );

  String got = instr.readLine();


One day I will put these someplace that I remember where they are,
but by then I will probably have forgotten what they are for...

MS
                

manu suryavansh wrote:
Hi,
Thanks for the help. I am planning to take the byte array and then write it to file using java i/o or may be to a database according to motes address. I don't understand what you meant by- work out the sequence of stream opens needed to use Java file i/o directly. Thank you
Manu Suryavansh


*/Michael Schippling <[EMAIL PROTECTED]>/* wrote:

    You should be able to modify Listen.java to dump the data in any
    format you like. You can then just redirect it's output to a file
    Listen > file.txt
    or for extra credit work out the sequence of stream opens needed
    to use Java file i/o directly.

    MS

    manu suryavansh wrote:
     > Hi,
     > I am sending 10 sensor readings in one packet using Multihop. I just
     > want to store the reading in a text file corresponding to each
    mote. I
     > don't want any GUI display.
     > Can somebody please tell me how to get started?
     > I have tried to understand the Trawler (Surge) but I find it very
     > complicated and there is no documentation.
     > I want to know that since I want to write readings in a file,
    should I
     > write in the file in append mode. With the trawler application I
    think
     > the readings are stored in an array and on selecting save all the
     > reading are saved at once but in this case only approximately 16000
     > reading can be saved.
     >
     > Thank you
     > Manu Suryavansh
     > University of Florida
     >
     >
     >
    ------------------------------------------------------------------------
     > No need to miss a message. Get email on-the-go
     >
     > with Yahoo! Mail for Mobile. Get started.
     >
     >
     >
     >
    ------------------------------------------------------------------------
     >
     > _______________________________________________
     > Tinyos-help mailing list
     > [EMAIL PROTECTED]
     >
    https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


------------------------------------------------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos. <http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3LWNhcnM->
_______________________________________________
Tinyos-help mailing list
[EMAIL PROTECTED]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to