         
         let cpf = fopen(patchFilePathBytes, r)
         if cpf == nil {
-            log("unable to open patch file c")
+            let s = String.fromCString(strerror(errno))
+            let ff = String.fromCString(patchFilePathBytes)
+            log("unable to open patch file c: \(s) \(ff)")
             throw BRBSPatchError.Unknown
         }
         let cpfseek = fseeko(cpf, 32, SEEK_SET)

            }
            
            // add old data to diff string
            for i in 0...(Int(crtl[0]) - 1) {
                if (oldPos + i >= 0) && (oldPos + i < oldSize) {
                    let np = Int(newPos) + i, op = Int(oldPos) + i
                    new[np] = new[np] &+ old[op]
                }
            }
            

            }
            return y
        }
        let patchFilePathBytes = UnsafePointer<Int8>((patchFilePath as NSString).UTF8String)
        let r = UnsafePointer<Int8>(("r" as NSString).UTF8String)
        
        // open patch file
        guard let f = NSFileHandle(forReadingAtPath: patchFilePath) else {
