本文整理汇总了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();
}