FileSystemAdapter
Defined in: obsidian.d.ts:1591
Implementation of the vault adapter for desktop.
Extends
Implements
Constructors
new FileSystemAdapter()
new FileSystemAdapter():
FileSystemAdapter
Returns
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
Inherited from
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
Inherited from
fs
fs:
__module
Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:18
Reference to node fs module
fsPromises
fsPromises:
__module
Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:22
Reference to node fs:promises module
ipcRenderer?
optional
ipcRenderer:IpcRenderer
Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:26
Reference to electron ipcRenderer module
path
path:
PlatformPath
Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:32
Reference to node path module
promise
promise:
Promise
<unknown
>
Defined in: src/obsidian/internals/PromisedQueue.d.ts:3
Implementation of
Inherited from
url()
url: (
url
,base
?) =>URL
Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:36
Reference to node URL module
Parameters
url
string
| URL
base?
string
| URL
Returns
prototype
prototype:
URL
canParse()
Parameters
url
string
| URL
base?
string
| URL
Returns
boolean
createObjectURL()
Parameters
obj
Returns
string
parse()
Parameters
url
string
| URL
base?
string
| URL
Returns
null
| URL
revokeObjectURL()
Parameters
url
string
Returns
void
watcher
watcher:
null
Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:40
Seems to always be null
and unused.
Methods
_exists()
_exists(
fullPath
,sensitive
?):Promise
<boolean
>
Defined in: src/obsidian/augmentations/DataAdapter.d.ts:32
Check if a file exists.
Parameters
fullPath
string
Full path to the file.
sensitive?
boolean
Whether to check case-sensitive.
Returns
Promise
<boolean
>
A promise that resolves to true
if the file exists, false
otherwise.
Implementation of
Inherited from
append()
append(
normalizedPath
,data
,options
?):Promise
<void
>
Defined in: obsidian.d.ts:1637
Parameters
normalizedPath
string
data
string
options?
Returns
Promise
<void
>
Implementation of
Inherited from
copy()
copy(
normalizedPath
,normalizedNewPath
):Promise
<void
>
Defined in: obsidian.d.ts:1664
Parameters
normalizedPath
string
normalizedNewPath
string
Returns
Promise
<void
>
Implementation of
Inherited from
copyRecursive()
copyRecursive(
sourcePath
,destinationPath
):Promise
<void
>
Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:57
Copy a file or directory recursively.
Parameters
sourcePath
string
Source path.
destinationPath
string
Destination path.
Returns
Promise
<void
>
A promise that resolves when the copy is complete.
exists()
exists(
normalizedPath
,sensitive
?):Promise
<boolean
>
Defined in: obsidian.d.ts:1668
Parameters
normalizedPath
string
sensitive?
boolean
Returns
Promise
<boolean
>
Implementation of
Inherited from
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:61
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:68
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
Inherited from
getFullRealPath()
getFullRealPath(
normalizedPath
):string
Defined in: src/obsidian/augmentations/DataAdapter.d.ts:46
Get canonical full path of file.
Parameters
normalizedPath
string
Normalized path to file.
Returns
string
String full path to file.
Implementation of
Inherited from
getName()
getName():
string
Defined in: obsidian.d.ts:1596
Returns
string
Implementation of
Inherited from
getRealPath()
getRealPath(
path
):string
Defined in: src/obsidian/augmentations/DataAdapter.d.ts:55
Get normalized path. For vault-relative path, it’s normalized vault-relative path. For absolute path, it’s path as is.
Parameters
path
string
Path to file.
Returns
string
Normalized path.
Implementation of
Inherited from
getResourcePath()
getResourcePath(
normalizedPath
):string
Defined in: obsidian.d.ts:1646
Parameters
normalizedPath
string
Returns
string
Implementation of
Inherited from
list()
list(
normalizedPath
):Promise
<ListedFiles
>
Defined in: obsidian.d.ts:1677
Parameters
normalizedPath
string
Returns
Implementation of
Inherited from
mkdir()
mkdir(
normalizedPath
):Promise
<void
>
Defined in: obsidian.d.ts:1605
Parameters
normalizedPath
string
Returns
Promise
<void
>
Implementation of
Inherited from
process()
process(
normalizedPath
,fn
,options
?):Promise
<string
>
Defined in: obsidian.d.ts:1641
Parameters
normalizedPath
string
fn
(data
) => string
options?
Returns
Promise
<string
>
Implementation of
Inherited from
queue()
queue<
T
>(fn
):Promise
<T
>
Defined in: src/obsidian/internals/PromisedQueue.d.ts:5
Type Parameters
• T
Parameters
fn
() => T
| Promise
<T
>
Returns
Promise
<T
>
Implementation of
Inherited from
read()
read(
normalizedPath
):Promise
<string
>
Defined in: obsidian.d.ts:1621
Parameters
normalizedPath
string
Returns
Promise
<string
>
Implementation of
Inherited from
readBinary()
readBinary(
normalizedPath
):Promise
<ArrayBuffer
>
Defined in: obsidian.d.ts:1625
Parameters
normalizedPath
string
Returns
Implementation of
Inherited from
reconcileFileCreation()
reconcileFileCreation(
normalizedPath
,normalizedNewPath
,stats
):Promise
<void
>
Defined in: src/obsidian/augmentations/FileSystemAdapter.d.ts:85
Reconcile file creation
Parameters
normalizedPath
string
Path to file
normalizedNewPath
string
Path to new file
stats
Stats
Stats object
Returns
Promise
<void
>
remove()
remove(
normalizedPath
):Promise
<void
>
Defined in: obsidian.d.ts:1655
Parameters
normalizedPath
string
Returns
Promise
<void
>
Implementation of
Inherited from
rename()
rename(
normalizedPath
,normalizedNewPath
):Promise
<void
>
Defined in: obsidian.d.ts:1660
Parameters
normalizedPath
string
normalizedNewPath
string
Returns
Promise
<void
>
Implementation of
Inherited from
rmdir()
rmdir(
normalizedPath
,recursive
):Promise
<void
>
Defined in: obsidian.d.ts:1617
Parameters
normalizedPath
string
recursive
boolean
Returns
Promise
<void
>
Implementation of
Inherited from
stat()
Defined in: obsidian.d.ts:1673
Parameters
normalizedPath
string
Returns
Implementation of
Inherited from
trashLocal()
trashLocal(
normalizedPath
):Promise
<void
>
Defined in: obsidian.d.ts:1613
Parameters
normalizedPath
string
Returns
Promise
<void
>
Implementation of
Inherited from
trashSystem()
trashSystem(
normalizedPath
):Promise
<boolean
>
Defined in: obsidian.d.ts:1609
Parameters
normalizedPath
string
Returns
Promise
<boolean
>
Implementation of
Inherited from
write()
write(
normalizedPath
,data
,options
?):Promise
<void
>
Defined in: obsidian.d.ts:1629
Parameters
normalizedPath
string
data
string
options?
Returns
Promise
<void
>
Implementation of
Inherited from
writeBinary()
writeBinary(
normalizedPath
,data
,options
?):Promise
<void
>
Defined in: obsidian.d.ts:1633
Parameters
normalizedPath
string
data
options?
Returns
Promise
<void
>
Implementation of
Inherited from
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