本文整理匯總了TypeScript中pathwatcher.File類的典型用法代碼示例。如果您正苦於以下問題:TypeScript File類的具體用法?TypeScript File怎麽用?TypeScript File使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了File類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: readFile
// Reading and Writing
async function readFile() {
str = await file.read();
}
示例2: writeFile
async function writeFile() {
await file.write("Test");
}
示例3: getFileRealPath
async function getFileRealPath() {
str = await file.getRealPath();
}
示例4: getFileDigest
async function getFileDigest() {
str = await file.getDigest();
}
示例5: File
import { File, Directory } from "pathwatcher";
let bool: boolean;
let str: string;
let sub: EventKit.Disposable;
let file: PathWatcher.File;
let dir: PathWatcher.Directory;
// File =======================================================================
// Construction
file = new File("Test.file");
new File("Test.file", false);
async function fileCreation() {
bool = await file.create();
}
// Event Subscription
sub = file.onDidChange(() => {});
sub = file.onDidRename(() => {});
sub = file.onDidDelete(() => {});
sub = file.onWillThrowWatchError(() => {});
// File Metadata
bool = file.isFile();
bool = file.isDirectory();
bool = file.isSymbolicLink();
async function fileExists() {
bool = await file.exists();
示例6: fileExists
async function fileExists() {
bool = await file.exists();
}
示例7: fileCreation
async function fileCreation() {
bool = await file.create();
}