         let firstChar = "X"
         var data : NSData! = firstChar.dataUsingEncoding(NSUTF8StringEncoding)
         
-        return data.writeToURL(self.url, atomically: true)
+        // TRUE if the operation succeeds, otherwise FALSE.
+        return data.writeToURL(self.url, options: .DataWritingAtomic , error: &self.error)
     }
     
     // override in subclasses
-    // This method is called only if the file is new
+    // This method is called only if the file is new and no error is occurred
     // The intension is to write the datablock number 0
     func initStore() {
         

    let blockSize = sizeof(H) + sizeof(D)  // test as CUnsignedLongLong
    
    public var error: NSError?  // readonly?
    
    var url: NSURL!
    var fileHandle: NSFileHandle!

        
        if !url.isFileExisting() {
            
            if self.createNewFile() {
                newFile = true
            } else {
                errorOccurred = true
            }
          
            // TODO  add error handling
            // - out of memory
            // - no access
            
        }
        
        if !errorOccurred {
            self.fileHandle = NSFileHandle.fileHandleForUpdatingURL(url, error: &self.error)
        }
       
        if self.fileHandle != nil {
            
            self.endOfFile = self.fileHandle.seekToEndOfFile()
            
            // central check of there store need an init
            // or a existing store need to read configuration
            if self.newFile {
                initStore()
            } else {
                readStoreConfiguration()
            }
            
        } else {
            errorOccurred = true
        }
    }
    
    deinit {
        if !errorOccurred {
            self.fileHandle.closeFile();
        }
    }
    
    // override in subclasses
