node: Add methods fs.access(), fs.accessSync and related constants.

This commit is contained in:
itokentr
2015-06-23 19:43:59 +09:00
parent 979de8c421
commit a44984a2d9

13
node/node.d.ts vendored
View File

@@ -1264,6 +1264,19 @@ declare module "fs" {
export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher;
export function exists(path: string, callback?: (exists: boolean) => void): void;
export function existsSync(path: string): boolean;
/** Constant for fs.access(). File is visible to the calling process. */
export var F_OK: number;
/** Constant for fs.access(). File can be read by the calling process. */
export var R_OK: number;
/** Constant for fs.access(). File can be written by the calling process. */
export var W_OK: number;
/** Constant for fs.access(). File can be executed by the calling process. */
export var X_OK: number;
/** Tests a user's permissions for the file specified by path. */
export function access(path: string, callback: (err: NodeJS.ErrnoException) => void): void;
export function access(path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;
/** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */
export function accessSync(path: string, mode ?: number): void;
export function createReadStream(path: string, options?: {
flags?: string;
encoding?: string;