                             fileHandle.seek(toFileOffset: position)
                             offset = (i==nb ? r : maxSize)
                             position += offset
-                             var data=fileHandle.readData(ofLength: Int(offset))
-                                if compress{
-                                    data = try data.compress(algorithm: .lz4)
-                                }
-                                if encrypt {
-                                    data = try Bartleby.cryptoDelegate.encryptData(data)
-                                }
-                                try __writeData(data: data,to:folderPath)
+                            var data=fileHandle.readData(ofLength: Int(offset))
+                            if compress{
+                                data = try data.compress(algorithm: .lz4)
+                            }
+                            if encrypt {
+                                data = try Bartleby.cryptoDelegate.encryptData(data)
+                            }
+                            try __writeData(data: data,to:folderPath)
 
                         })
                     }

        }
    }

    public struct Chunk {
        var relativePath:String
        var sha1:String
        var originalSize:Int
    }

    //public func autoreleasepool<Result>(invoking body: () throws -> Result) rethrows -> Result

    public func breakIntoChunk(fileAt path:String,destination folderPath:String, chunkMaxSize:Int=10*MB,compress:Bool,encrypt:Bool,success:@escaping ([Chunk])->(), failure:@escaping (String)->()){

        // We want this operation not to be blocking the UI
        Async.utility {

            // Read each chunk efficiently

    ///   - relativePath: the relative Path of the Node
    ///   - authorized: the User UIDS or "*" if public
    ///   - deleteOriginal: should we delete the original?
    ///   - compressed: should we zip the node
    ///   - crypted: should we encrypt the node
    ///   - priority: synchronization priority (higher == will be synchronized before the other nodes)
    /// - Returns: the node
    public func add(original absolutePath:String, relativePath:String,authorized:[String],deleteOriginal:Bool=false,compressed:Bool=false,crypted:Bool=true,priority:Int=0)throws->Node{
        return Node()
    }

