Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Latest commit

 

History

History
44 lines (35 loc) · 2.19 KB

README.md

File metadata and controls

44 lines (35 loc) · 2.19 KB

Warning

由于Serein从2.0起已内置文件相关的函数,故此插件不再更新。

stdio

一个提供文件读写、目录创建删除等功能的前置插件

Tip

你可以在此处找到更详细的说明

函数一览

declare function appendTextToFile(path: string, content: string, encoding?: any): void;
declare function appendLinesToFile(path: string, content: string[], encoding?: any): void;
declare function readAllLinesFromFile(path: string, encoding?: any): string[];
declare function readAllTextFromFile(path: string, encoding?: any): string;
declare function writeLinesToFile(path: string, content: string[], encoding?: any): void;
declare function writeAllTextToFile(path: string, contents?: string, encoding?: any): void;

declare function existFile(path: string): boolean;
declare function copyFile(sourceFileName: string, destFileName: string, overwrite?: boolean): void;
declare function deleteFile(path: string): void;
declare function moveFile(sourceFileName: string, destFileName: string, overwrite?: boolean): void;
declare function renameFile(sourceFileName: string, destFileName: string): void;

declare function existFileOrDirectory(path: string): boolean;
declare function existDirectory(path: string): boolean;
declare function createDirectory(path: string): void;
declare function deleteDirectory(path: string): void;
declare function moveDirectory(sourceDirName: string, destDirName: string): void;

declare function getFiles(path: string, searchPattern?: string, searchOption?: any): string[];
declare function getDirectories(path: string, searchPattern?: string, searchOption?: any): string[];
declare function getDirectoryName(path: string): string | null;
declare function getFileName(path: string): string | null;
declare function getExtension(path: string): string | null;
declare function getFileNameWithoutExtension(path: string): string | null;
declare function getFullPath(path: string, basePath?: string): string;
declare function getFileCreationTime(path: string): Date;
declare function getFileLastAccessTime(path: string): Date;
declare function getFileLastWriteTime(path: string): Date;