VirtualFileSystem
A JSON-backed, read-only virtual file system.
class VirtualFileSystem
A JSON-backed, read-only virtual file system.
class VirtualFileSystem
import Basics
protocol Sendable
init(path: TSCAbsolutePath, fs: FileSystem) throws
static func serializeDirectoryTree(_ directoryPath: AbsolutePath, into vfsPath: AbsolutePath, fs: FileSystem, includeContents: [AbsolutePath]) throws
Write information about the directory tree at directoryPath
into a JSON file at vfsPath
. This can later be used to construct a VirtualFileSystem
object.
var cachesDirectory: TSCAbsolutePath?
let currentWorkingDirectory: TSCAbsolutePath?
var homeDirectory: AbsolutePath
var tempDirectory: AbsolutePath
func changeCurrentWorkingDirectory(to path: TSCAbsolutePath) throws
func chmod(_ mode: FileMode, path: TSCAbsolutePath, options: Set<FileMode.Option>) throws
func copy(from sourcePath: TSCAbsolutePath, to destinationPath: TSCAbsolutePath) throws
func createDirectory(_ path: TSCAbsolutePath, recursive: Bool) throws
func createSymbolicLink(_ path: TSCAbsolutePath, pointingAt destination: TSCAbsolutePath, relative: Bool) throws
func exists(_ path: TSCAbsolutePath, followSymlink: Bool) -> Bool
func getDirectoryContents(_ path: TSCAbsolutePath) throws -> [String]
func getFileInfo(_ path: TSCAbsolutePath) throws -> FileInfo
func isDirectory(_ path: TSCAbsolutePath) -> Bool
func isExecutableFile(_ path: TSCAbsolutePath) -> Bool
func isFile(_ path: TSCAbsolutePath) -> Bool
func isReadable(_ path: TSCAbsolutePath) -> Bool
func isSymlink(_ path: TSCAbsolutePath) -> Bool
func isWritable(_: TSCAbsolutePath) -> Bool
func move(from sourcePath: TSCAbsolutePath, to destinationPath: TSCAbsolutePath) throws
func readFileContents(_ path: TSCAbsolutePath) throws -> ByteString
func removeFileTree(_: TSCAbsolutePath) throws
func writeFileContents(_ path: TSCAbsolutePath, bytes: ByteString) throws