What happened with this file?
infile = "\\test data.txt";
outstr = OpenWrite[infile];
instr = OpenRead[infile];
Read[instr, Record];
Close[instr];
All content of "test data.txt" was lost.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityWhat happened with this file?
infile = "\\test data.txt";
outstr = OpenWrite[infile];
instr = OpenRead[infile];
Read[instr, Record];
Close[instr];
All content of "test data.txt" was lost.
OpenWrite["file"] open an output stream to a file, wiping out the previous contents of the file
... it's gone, you deleted it :
OpenAppend
. $\endgroup$ – Mr.Wizard Mar 22 '13 at 16:52