help pass cardinfo, error card write arduino mini pro

hello i am succes using arduino uno but this time i using arduino mini pro got some error
i able to run cardinfo

Initializing SD card...Wiring is correct and a card is present.

Card type: SD2

Volume type is FAT16

Volume size (bytes): 1948975104
Volume size (Kbytes): 1903296
Volume size (Mbytes): 1858

Files found on the card (name, date and size in bytes): 
SYSTEM~1/     2014-06-11 16:07:14
  INDEXE~1      2014-06-11 16:07:14 76
LOG.IKM       2014-06-11 16:07:34 0
TEST.TXT      2014-06-11 16:07:28 0

but i using read write i got error like this

Initializing SD card...initialization done.
Writing to test.txt...done.
error opening test.txt

please help
i search every where but not find any clue

Post your program.

Modifying the card CardInfo program to access files is not a good approach. You should start with another example.

this my program

#include <LiquidCrystal.h>
#include <SPI.h>
#include <SD.h>
#include <Wire.h>
#include "RTClib.h"

RTC_Millis rtc;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, A3, A2, A1, A0);
int s_puas = 7;
int puas = 6;
int t_puas = 5;
int datalog;
int brig;

Sd2Card card;
SdVolume vol;
SdFile root;
//int ledPin = 13;

File myFile;

// Chip select pin for SD card.
const int sdCsPin = 4;

// Replace the -1 with the CS pin number of any shared SPI device.
const int sharedCsPin = -1;

void setup() {
  Serial.begin(9600);

  pinMode(10, OUTPUT);
digitalWrite(10, HIGH);

  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(3, LOW);
  pinMode(2, HIGH);
  rtc.begin(DateTime(__DATE__, __TIME__));
  // Serial.begin(9600);
  lcd.begin(16, 2);



 
  
  DateTime now = rtc.now();
  Serial.print(now.year(), DEC);
  Serial.print('/');
  Serial.print(now.month(), DEC);
  Serial.print('/');
  Serial.print(now.day(), DEC);
  Serial.print(' ');
  Serial.print(now.hour(), DEC);
  Serial.print(':');
  Serial.print(now.minute(), DEC);
  Serial.print(':');
  Serial.print(now.second(), DEC);
  Serial.println();
  
    // Disable any other SPI devices
  if (sharedCsPin >= 0) {
    pinMode(sharedCsPin, OUTPUT);
    digitalWrite(sharedCsPin, HIGH);
  }
  
  // Try to initialize the SD card
  if (card.init(SPI_HALF_SPEED, sdCsPin)) {
    Serial.println("card init OK");
  } else {
    Serial.print("errorCode: ");
    Serial.println(card.errorCode(), HEX);
    Serial.print("errorData: ");
    Serial.println(card.errorData(), HEX);
    return;
  }
  
  // Try to initialize the FAT volume.
  if (vol.init(&card)) {
    Serial.println("vol init OK");
  } else {
    Serial.println("vol init failed");
    return;
  }
  
  // Try to open root
  if (root.openRoot(&vol)) {
    Serial.println("open root OK");
  } else {
    Serial.println("open root failed");
  }


  
 pinMode(10, OUTPUT);
 digitalWrite(10, HIGH);
  if (!SD.begin(sdCsPin)) {
    lcd.print("MMC ERROR ");
    delay(20000);
    return;
  }
  // following line sets the RTC to the date & time this sketch was compiled



  //Serial.println("initialization done.");


  pinMode(t_puas, INPUT_PULLUP);
  pinMode(s_puas, INPUT_PULLUP);
  pinMode(puas, INPUT_PULLUP);
  //digitalWrite(puas, HIGH); // connect internal pull-up


  // set up the LCD's number of columns and rows:


  pinMode(7, OUTPUT);
  digitalWrite(7, LOW);
  delay(100);

  pinMode(7, LOW);
  pinMode(7, INPUT_PULLUP);

  // Print a message to the LCD.
  lcd.clear();
  lcd.print("CLIPNINDO    ");
  lcd.setCursor(0, 1);
  lcd.print("---IKM---");
  delay(2000);
  lcd.clear();





}

void loop() {
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):

  // print the number of seconds since reset:


  lcd.setCursor(0, 0);
  // print the number of seconds since reset:
  lcd.clear();

  lcd.setCursor(0, 1);

  /*
         DateTime now = rtc.now();
    lcd.print('/');
      lcd.print(now.year(), DEC);
      lcd.print('/');
      lcd.print(now.month(), DEC);
      lcd.print('/');
      lcd.print(now.day(), DEC);
      lcd.print('/');
      lcd.println(3);
  */

  delay(100);






  if (digitalRead(t_puas)  != HIGH )  // when pin goes LOW
  {
    lcd.clear();
    lcd.setCursor(0, 0);
    // print the number of seconds since reset:
    //lcd.print("TIDAK PUAS");
    lcd.setCursor(0, 1);
    lcd.print("TERIMA KASIH");

    myFile = SD.open("log.ikm", FILE_WRITE);
    if (myFile) {
      DateTime now = rtc.now();
      myFile.print('/');
      myFile.print(now.year(), DEC);
      myFile.print('/');
      myFile.print(now.month(), DEC);
      myFile.print('/');
      myFile.print(now.day(), DEC);
      myFile.print('/');
      myFile.println(3);
      myFile.close();




    }
    else
    {
    Serial.println("error tulis");
    }


    pinMode(7, OUTPUT);
    digitalWrite(7, LOW);
    delay(200);
    pinMode(7, LOW);
    pinMode(7, INPUT_PULLUP);

    delay(5000);


  }

  if (digitalRead(puas)  != HIGH )  // when pin goes LOW
  {
    lcd.clear();
    lcd.setCursor(0, 0);
    // print the number of seconds since reset:
    //lcd.print("PUAS");
    lcd.setCursor(0, 1);
    lcd.print("TERIMA KASIH");

    myFile = SD.open("log.ikm", FILE_WRITE);
    if (myFile) {
      DateTime now = rtc.now();
      myFile.print('/');
      myFile.print(now.year(), DEC);
      myFile.print('/');
      myFile.print(now.month(), DEC);
      myFile.print('/');
      myFile.print(now.day(), DEC);
      myFile.print('/');
      myFile.println(2);
      myFile.close();

    }
      else
    {
    Serial.println("error tulis");
    }


    pinMode(7, OUTPUT);
    digitalWrite(7, LOW);
    delay(200);
    pinMode(7, LOW);
    pinMode(7, INPUT_PULLUP);

    delay(5000);
  }

  if (digitalRead(s_puas)  != HIGH )  // when pin goes LOW
  {
    lcd.clear();
    lcd.setCursor(0, 0);
    // print the number of seconds since reset:
    //lcd.print("SANGAT PUAS");
    lcd.setCursor(0, 1);
    lcd.print("TERIMA KASIH");

    myFile = SD.open("log.ikm", FILE_WRITE);
    if (myFile.available()) {
      DateTime now = rtc.now();
      myFile.print('/');
      myFile.print(now.year(), DEC);
      myFile.print('/');
      myFile.print(now.month(), DEC);
      myFile.print('/');
      myFile.print(now.day(), DEC);
      myFile.print('/');
      myFile.println(1);
      myFile.close();

    }
      else
    {
    Serial.println("error tulis");
    }
    
    pinMode(7, OUTPUT);
    digitalWrite(7, LOW);
    delay(200);
    pinMode(7, LOW);
    pinMode(7, INPUT_PULLUP);

    delay(5000);
    // turn on LED
  }



}