returns position of files problem?

file.position() returns the file starting position?


why the gap is 32 every file position?
and the TEST.TXT’s position is not 128(which is 96+32)
the position become so big.

Why The root.position and Last value is different in the image?

#include <SD.h>

File myFile,root;

void setup()
{
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  Serial.print("Initializing SD card...");
  // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
  // Note that even if it's not used as the CS pin, the hardware SS pin 
  // (10 on most Arduino boards, 53 on the Mega) must be left as an output 
  // or the SD library functions will not work. 
  pinMode(10, OUTPUT);

  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");
  

  // open a new file and immediately close it:
  Serial.println("Creating 2222.txt...");
  myFile = SD.open("2222.txt", FILE_WRITE);
  delay(1500);
  Serial.print("create.position:  ");
  Serial.println(myFile.position()); 
  myFile.close();
  Serial.println("Delay");
  delay(3000);
  
  root = SD.open("/");
  Serial.print("root.position:  ");
  Serial.println(root.position());
  printDirectory(root, 0);

  
  Serial.println("Removing 2222.txt...");
  SD.remove("2222.txt");
  
}

void loop()
{
  // nothing happens after setup finishes.
}


void printDirectory(File dir, int numTabs) {
 
 Serial.print("FIRST:  ");
 Serial.println(dir.position());
 dir.seek(0);
 Serial.print("Seek");
 Serial.println(dir.position());
 Serial.print("dir.size");
 Serial.println(dir.size());
   while(true) {
     
     File entry =  dir.openNextFile();
     if (! entry) {
       // no more files
       break;
     }
     for (uint8_t i=0; i<numTabs; i++) {
       Serial.print('\t');
     }
     Serial.print(entry.name());

     if (entry.isDirectory()) {
       Serial.println("/");
       printDirectory(entry, numTabs+1);
     } else {
       // files have sizes, directories do not
       Serial.print("\t\t");
       Serial.println(entry.size(), DEC);
       Serial.print("Position:  ");
       Serial.println(dir.position());
     }
     entry.close();
   }
   
   Serial.print("LAST:  ");
   Serial.println(dir.position());
}

the image http://ppt.cc/6KmbZ

AKAI:
file.position() returns the file starting position?

the image: http://ppt.cc/6KmbZ
why the gap is 32 every file position?
and the TEST.TXT’s position is not 128(which is 96+32)
the position become so big.

Why The root.position and Last value is different in the image?

#include <SD.h>

File myFile,root;

void setup()
{
// Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

Serial.print(“Initializing SD card…”);
  // On the Ethernet Shield, CS is pin 4. It’s set as an output by default.
  // Note that even if it’s not used as the CS pin, the hardware SS pin
  // (10 on most Arduino boards, 53 on the Mega) must be left as an output
  // or the SD library functions will not work.
  pinMode(10, OUTPUT);

if (!SD.begin(4)) {
    Serial.println(“initialization failed!”);
    return;
  }
  Serial.println(“initialization done.”);

// open a new file and immediately close it:
  Serial.println(“Creating 2222.txt…”);
  myFile = SD.open(“2222.txt”, FILE_WRITE);
  delay(1500);
  Serial.print(“create.position:  “);
  Serial.println(myFile.position());
  myFile.close();
  Serial.println(“Delay”);
  delay(3000);
 
  root = SD.open(”/”);
  Serial.print("root.position:  ");
  Serial.println(root.position());
  printDirectory(root, 0);

Serial.println(“Removing 2222.txt…”);
  SD.remove(“2222.txt”);
 
}

void loop()
{
  // nothing happens after setup finishes.
}

void printDirectory(File dir, int numTabs) {

Serial.print("FIRST:  ");
Serial.println(dir.position());
dir.seek(0);
Serial.print(“Seek”);
Serial.println(dir.position());
Serial.print(“dir.size”);
Serial.println(dir.size());
  while(true) {
   
    File entry =  dir.openNextFile();
    if (! entry) {
      // no more files
      break;
    }
    for (uint8_t i=0; i<numTabs; i++) {
      Serial.print(’\t’);
    }
    Serial.print(entry.name());

if (entry.isDirectory()) {
      Serial.println("/");
      printDirectory(entry, numTabs+1);
    } else {
      // files have sizes, directories do not
      Serial.print("\t\t");
      Serial.println(entry.size(), DEC);
      Serial.print("Position:  ");
      Serial.println(dir.position());
    }
    entry.close();
  }
 
  Serial.print("LAST:  ");
  Serial.println(dir.position());
}