                 throw FileSystemError(.ioError(code: errno), path)
             }
             if n != contents.count {
-                throw FileSystemError(.unknownOSError, path)
+                throw FileSystemError(.mismatchedByteCount(expected: contents.count, actual: n), path)
             }
             break
         }

        case TSCLibc.ENOTDIR:
            self.init(.notDirectory, path)
        default:
            self.init(.unknownOSError, path)
        }
    }
}

        }

        guard FileManager.default.changeCurrentDirectoryPath(path.pathString) else {
            throw FileSystemError(.couldNotChangeDirectory, path)
        }
    }

