         /// This is thrown when copying or moving a file or directory but the destination
         /// path already contains a file or folder.
         case alreadyExistsAtDestination
+
+        /// If an unspecified error occurs when trying to change directories.
+        case couldNotChangeDirectory
+
+        /// If a mismatch is detected in byte count when writing to a file.
+        case mismatchedByteCount(expected: Int, actual: Int)
     }
 
     /// The kind of the error being raised.

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

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