Skip to content

FileSystemAdapter

Defined in: obsidian.d.ts:1591

Implementation of the vault adapter for desktop.

Extends

Implements

Constructors

new FileSystemAdapter()

new FileSystemAdapter(): FileSystemAdapter

Returns

FileSystemAdapter

Properties

basePath

basePath: string

Defined in: src/obsidian/augmentations/DataAdapter.d.ts:13

Base OS path for the vault (e.g. /home/user/vault, or C:\Users\user\documents\vault)

Implementation of

DataAdapter.basePath

Inherited from

DataAdapter.basePath


files

files: DataAdapterFilesRecord

Defined in: src/obsidian/augmentations/DataAdapter.d.ts:17

Mapping of file/folder path to vault entry, includes non-MD files

Implementation of

DataAdapter.files

Inherited from

DataAdapter.files


fs

fs: __module

Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:16

Reference to node fs module


fsPromises

fsPromises: __module

Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:20

Reference to node fs:promises module


ipcRenderer?

optional ipcRenderer: IpcRenderer

Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:24

Reference to electron ipcRenderer module


path

path: PlatformPath

Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:28

Reference to node path module


url

url: URL

Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:32

Reference to node URL module

Methods

append()

append(normalizedPath, data, options?): Promise<void>

Defined in: obsidian.d.ts:1637

Parameters

normalizedPath

string

data

string

options?

DataWriteOptions

Returns

Promise<void>

Implementation of

DataAdapter.append

Inherited from

DataAdapter.append


copy()

copy(normalizedPath, normalizedNewPath): Promise<void>

Defined in: obsidian.d.ts:1664

Parameters

normalizedPath

string

normalizedNewPath

string

Returns

Promise<void>

Implementation of

DataAdapter.copy

Inherited from

DataAdapter.copy


exists()

exists(normalizedPath, sensitive?): Promise<boolean>

Defined in: obsidian.d.ts:1668

Parameters

normalizedPath

string

sensitive?

boolean

Returns

Promise<boolean>

Implementation of

DataAdapter.exists

Inherited from

DataAdapter.exists


getBasePath()

Call Signature

getBasePath(): string

Defined in: obsidian.d.ts:1600

Returns

string

Call Signature

getBasePath(): string

Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:47

Get base path of vault (OS path)

Returns

string


getFilePath()

Call Signature

getFilePath(normalizedPath): string

Defined in: obsidian.d.ts:1651

Returns the file:// path of this file

Parameters
normalizedPath

string

Returns

string

Call Signature

getFilePath(normalizedPath): string

Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:54

Get full path of file (OS path)

Parameters
normalizedPath

string

Path to file

Returns

string

URL path to file


getFullPath()

getFullPath(normalizedPath): string

Defined in: obsidian.d.ts:1682

Parameters

normalizedPath

string

Returns

string

Implementation of

DataAdapter.getFullPath

Inherited from

DataAdapter.getFullPath


getFullRealPath()

getFullRealPath(normalizedPath): string

Defined in: src/obsidian/augmentations/DataAdapter.d.ts:40

Get full path of file (OS path)

Parameters

normalizedPath

string

Path to file

Returns

string

String full path to file

Implementation of

DataAdapter.getFullRealPath

Inherited from

DataAdapter.getFullRealPath


getName()

getName(): string

Defined in: obsidian.d.ts:1596

Returns

string

Implementation of

DataAdapter.getName

Inherited from

DataAdapter.getName


getResourcePath()

getResourcePath(normalizedPath): string

Defined in: obsidian.d.ts:1646

Parameters

normalizedPath

string

Returns

string

Implementation of

DataAdapter.getResourcePath

Inherited from

DataAdapter.getResourcePath


list()

list(normalizedPath): Promise<ListedFiles>

Defined in: obsidian.d.ts:1677

Parameters

normalizedPath

string

Returns

Promise<ListedFiles>

Implementation of

DataAdapter.list

Inherited from

DataAdapter.list


mkdir()

mkdir(normalizedPath): Promise<void>

Defined in: obsidian.d.ts:1605

Parameters

normalizedPath

string

Returns

Promise<void>

Implementation of

DataAdapter.mkdir

Inherited from

DataAdapter.mkdir


process()

process(normalizedPath, fn, options?): Promise<string>

Defined in: obsidian.d.ts:1641

Parameters

normalizedPath

string

fn

(data) => string

options?

DataWriteOptions

Returns

Promise<string>

Implementation of

DataAdapter.process

Inherited from

DataAdapter.process


queue()

queue(next): Promise<void>

Defined in: src/obsidian/internals/PromisedQueue.d.ts:5

Parameters

next

() => void | Promise<void>

Returns

Promise<void>

Implementation of

DataAdapter.queue

Inherited from

DataAdapter.queue


read()

read(normalizedPath): Promise<string>

Defined in: obsidian.d.ts:1621

Parameters

normalizedPath

string

Returns

Promise<string>

Implementation of

DataAdapter.read

Inherited from

DataAdapter.read


readBinary()

readBinary(normalizedPath): Promise<ArrayBuffer>

Defined in: obsidian.d.ts:1625

Parameters

normalizedPath

string

Returns

Promise<ArrayBuffer>

Implementation of

DataAdapter.readBinary

Inherited from

DataAdapter.readBinary


remove()

remove(normalizedPath): Promise<void>

Defined in: obsidian.d.ts:1655

Parameters

normalizedPath

string

Returns

Promise<void>

Implementation of

DataAdapter.remove

Inherited from

DataAdapter.remove


rename()

rename(normalizedPath, normalizedNewPath): Promise<void>

Defined in: obsidian.d.ts:1660

Parameters

normalizedPath

string

normalizedNewPath

string

Returns

Promise<void>

Implementation of

DataAdapter.rename

Inherited from

DataAdapter.rename


rmdir()

rmdir(normalizedPath, recursive): Promise<void>

Defined in: obsidian.d.ts:1617

Parameters

normalizedPath

string

recursive

boolean

Returns

Promise<void>

Implementation of

DataAdapter.rmdir

Inherited from

DataAdapter.rmdir


stat()

stat(normalizedPath): Promise<null | Stat>

Defined in: obsidian.d.ts:1673

Parameters

normalizedPath

string

Returns

Promise<null | Stat>

Implementation of

DataAdapter.stat

Inherited from

DataAdapter.stat


trashLocal()

trashLocal(normalizedPath): Promise<void>

Defined in: obsidian.d.ts:1613

Parameters

normalizedPath

string

Returns

Promise<void>

Implementation of

DataAdapter.trashLocal

Inherited from

DataAdapter.trashLocal


trashSystem()

trashSystem(normalizedPath): Promise<boolean>

Defined in: obsidian.d.ts:1609

Parameters

normalizedPath

string

Returns

Promise<boolean>

Implementation of

DataAdapter.trashSystem

Inherited from

DataAdapter.trashSystem


write()

write(normalizedPath, data, options?): Promise<void>

Defined in: obsidian.d.ts:1629

Parameters

normalizedPath

string

data

string

options?

DataWriteOptions

Returns

Promise<void>

Implementation of

DataAdapter.write

Inherited from

DataAdapter.write


writeBinary()

writeBinary(normalizedPath, data, options?): Promise<void>

Defined in: obsidian.d.ts:1633

Parameters

normalizedPath

string

data

ArrayBuffer

options?

DataWriteOptions

Returns

Promise<void>

Implementation of

DataAdapter.writeBinary

Inherited from

DataAdapter.writeBinary


mkdir()

static mkdir(path): Promise<void>

Defined in: obsidian.d.ts:1691

Parameters

path

string

Returns

Promise<void>


readLocalFile()

static readLocalFile(path): Promise<ArrayBuffer>

Defined in: obsidian.d.ts:1687

Parameters

path

string

Returns

Promise<ArrayBuffer>