TExternalFile
Official
Represents a file that is outside the Vault. Can be used with the vault API just like any other file. Do not create these manually.
Import:
import { TExternalFile } from 'obsidian';Signature:
export class TExternalFile extends TFileExtends: TFile
Constructor
new TExternalFile(vault: Vault, path: string)Constructor.
To get the constructor instance, use getTFileConstructor from obsidian-typings/implementations.
Properties
| Property | Type | Description | |
|---|---|---|---|
| basename | string | The basename of the file (name without extension). (Inherited from TFile) | |
| extension | string | The extension of the file. (Inherited from TFile) | |
| name | string | The name of the file (with extension). (Inherited from TFile) | |
| saving | boolean | Whether the file is being saved. (Inherited from TFile) | |
| stat | FileStats | The stats of the file. (Inherited from TFile) |
Methods
| Method | Returns | Description | |
|---|---|---|---|
| cache(content) | void | Caches file's content, that can be retrieved via await app.vault.cachedRead(file).(Inherited from TFile) | |
| getRealPath() | string | Returns the physical path in the filesystem. | |
| getShortName() | string | Gets the short name of the file. For a/b/c.md, it returns c.For a/b/c.any-other-extension it returns c.any-other-extension.(Inherited from TFile) | |
| updateCacheLimit() | unknown | Removes the file from the cache if its content length greater than app.vault.cacheLimit.(Inherited from TFile) |