Skip to main content

IFileSystem

MS Code Extension API


MS Code Extension API / core/fileSystem/IFileSystem

core/fileSystem/IFileSystem

Interfaces

FileStat

Defined in: core/fileSystem/IFileSystem.ts:34

Normalized directory snapshot metadata record. Represents standard file or folder attributes returned during traversal passes.

Properties

isDirectory

isDirectory: boolean

Defined in: core/fileSystem/IFileSystem.ts:40

Flags whether the current node represents a container directory layout branch.

name

name: string

Defined in: core/fileSystem/IFileSystem.ts:36

The natural name of the node including extensions (e.g., 'index.tsx' or 'styles')

path

path: string

Defined in: core/fileSystem/IFileSystem.ts:38

Complete absolute canonical layout path target (e.g., '/storage/emulated/0/project/index.tsx')


IFileSystem

Defined in: core/fileSystem/IFileSystem.ts:47

Primary Core File System Abstract Boundary Protocol. Every environmental runtime adapter must implement this interface to drive data streams.

Methods

closeFolder()?

optional closeFolder(): void

Defined in: core/fileSystem/IFileSystem.ts:112

Optional cleanup routine: Detaches active document tracking listeners, flushes state tables, and unmounts folder tree file watchers safely.

Returns

void

copy()?

optional copy(fromPath, toPath): Promise<void>

Defined in: core/fileSystem/IFileSystem.ts:99

Optional optimization feature: Performs deep copies of files or complete subdirectory structures. *

Parameters
fromPath

string

Origin structural source link.

toPath

string

Target point destination link.

Returns

Promise<void>

delete()

delete(path): Promise<void>

Defined in: core/fileSystem/IFileSystem.ts:92

Erases a targeted filesystem node point from physical hardware storage allocations. If target matches a folder directory, it must perform deep recursive sweeps to purge all contents. *

Parameters
path

string

Target point node location tracking references to destroy.

Returns

Promise<void>

mkdir()

mkdir(path): Promise<void>

Defined in: core/fileSystem/IFileSystem.ts:78

Provisions a brand-new storage folder tracking boundary sequence on the system layout. *

Parameters
path

string

Target folder tree node to compile.

Returns

Promise<void>

openFolder()?

optional openFolder(): Promise<{ name?: string; path?: string; success: boolean; }>

Defined in: core/fileSystem/IFileSystem.ts:106

Optional platform anchor launcher: Triggers OS native system directory pickers to securely choose active root folder permissions coordinates for workspace mounting. *

Returns

Promise<{ name?: string; path?: string; success: boolean; }>

Response footprint variables.

readDir()

readDir(path): Promise<FileStat[]>

Defined in: core/fileSystem/IFileSystem.ts:57

Scans a target directory scope and returns an array of its top-level entry configurations. *

Parameters
path

string

Specific absolute location folder targeted for verification.

Returns

Promise<FileStat[]>

Flat collection holding individual directory layout metrics snapshots. *

Example
const files = await fs.readDir('/my-project');
// Expected: [{ name: 'src', path: '/my-project/src', isDirectory: true }, ...]
readFile()

readFile(path): Promise<string>

Defined in: core/fileSystem/IFileSystem.ts:64

Extracts data payload text streams out of a targeted layout node file. *

Parameters
path

string

Raw absolute filepath variable target.

Returns

Promise<string>

Standardized raw character string containing file content.

rename()

rename(oldPath, newPath): Promise<void>

Defined in: core/fileSystem/IFileSystem.ts:85

Mutates structural tracking properties, reassigning file labels or changing directory trees. *

Parameters
oldPath

string

Valid source coordinate point link where elements currently reside.

newPath

string

Destination layout path mapping where footprints must relocate.

Returns

Promise<void>

writeFile()

writeFile(path, content): Promise<void>

Defined in: core/fileSystem/IFileSystem.ts:72

Commits string data blocks directly back into a specified absolute file location node. If parent path branches do not exist, they should be automatically provisioned recursively. *

Parameters
path

string

Target location reference where content must be persisted.

content

string

Raw text payload block stream to save.

Returns

Promise<void>