             buffer2.deallocate()
         }
 
-        var bytesLeft = Int(size)
+        var bytesLeft = size
         while bytesLeft > 0 {
-            let bytesToRead = min(bufSize, bytesLeft)
+            let bytesToRead = Int(min(Int64(bufSize), bytesLeft))
             guard read(fd1, buffer1, bytesToRead) == bytesToRead else {
                 return false
             }

            guard memcmp(buffer1, buffer2, bytesToRead) == 0 else {
                return false
            }
            bytesLeft -= bytesToRead
        }
        return true
    }

    /* Process working directory management. Despite the fact that these are instance methods on FileManager, these methods report and change (respectively) the working directory for the entire process. Developers are cautioned that doing so is fraught with peril.
     */
    open var currentDirectoryPath: String {
        let length = Int(PATH_MAX) + 1
        var buf = [Int8](repeating: 0, count: length)
        getcwd(&buf, length)
        return string(withFileSystemRepresentation: buf, length: Int(strlen(buf)))
    }
    
    @discardableResult
