public static OutputStream openWrite(Context context,String filename) throws IOException {
  File out=context.getFileStreamPath(filename);
  out.renameTo(context.getFileStreamPath(filename + ".bak"));
  return context.openFileOutput(filename,Context.MODE_PRIVATE);
}

public static OutputStream openWrite ( Context context , String filename ) throws IOException { File out = context . getFileStreamPath ( filename ) ; out . renameTo ( context . getFileStreamPath ( filename + ".bak" ) ) ; return context . openFileOutput ( filename , Context . MODE_PRIVATE ) ; }
write to the given file in the private files dir , first renaming an old one to . bak
