0% found this document useful (0 votes)
36 views3 pages

102 Doc Update

This document describes several functions for changing file permissions and timestamps in Node.js. It includes both synchronous and asynchronous versions of functions like chmod(), lutimes(), and fchmod() along with their parameter definitions and return types.

Uploaded by

Rahat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views3 pages

102 Doc Update

This document describes several functions for changing file permissions and timestamps in Node.js. It includes both synchronous and asynchronous versions of functions like chmod(), lutimes(), and fchmod() along with their parameter definitions and return types.

Uploaded by

Rahat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

* @param path A path to a file.

If a URL is provided, it must use the


`file:` protocol.
* @param atime The last access time. If a string is provided, it will be
coerced to number.
* @param mtime The last modified time. If a string is provided, it will be
coerced to number.
*/
function __promisify__(path: PathLike, atime: string | number | Date,
mtime: string | number | Date): Promise<void>;
}

/**
* Change the file system timestamps of the symbolic link referenced by `path`.
Returns `undefined`,
* or throws an exception when parameters are incorrect or the operation fails.
* This is the synchronous version of `fs.lutimes()`.
* @param path A path to a file. If a URL is provided, it must use the `file:`
protocol.
* @param atime The last access time. If a string is provided, it will be
coerced to number.
* @param mtime The last modified time. If a string is provided, it will be
coerced to number.
*/
function lutimesSync(path: PathLike, atime: string | number | Date, mtime:
string | number | Date): void;

/**
* Asynchronous chmod(2) - Change permissions of a file.
* @param path A path to a file. If a URL is provided, it must use the `file:`
protocol.
* @param mode A file mode. If a string is passed, it is parsed as an octal
integer.
*/
function chmod(path: PathLike, mode: string | number, callback:
NoParamCallback): void;

// NOTE: This namespace provides design-time support for util.promisify.


Exported members do not exist at runtime.
namespace chmod {
/**
* Asynchronous chmod(2) - Change permissions of a file.
* @param path A path to a file. If a URL is provided, it must use the
`file:` protocol.
* @param mode A file mode. If a string is passed, it is parsed as an octal
integer.
*/
function __promisify__(path: PathLike, mode: string | number):
Promise<void>;
}

/**
* Synchronous chmod(2) - Change permissions of a file.
* @param path A path to a file. If a URL is provided, it must use the `file:`
protocol.
* @param mode A file mode. If a string is passed, it is parsed as an octal
integer.
*/
function chmodSync(path: PathLike, mode: string | number): void;
/**
* Asynchronous fchmod(2) - Change permissions of a file.
* @param fd A file descriptor.
* @param mode A file mode. If a string is passed, it is parsed as an octal
integer.
*/
function fchmod(fd: number, mode: string | number, callback: NoParamCallback):
void;

// NOTE: This namespace provides design-time support for util.promisify.


Exported members do not exist at runtime.
namespace fchmod {
/**
* Asynchronous fchmod(2) - Change permissions of a file.
* @param fd A file descriptor.
* @param mode A file mode. If a string is passed, it is parsed as an octal
integer.
*/
function __promisify__(fd: number, mode: string | number): Promise<void>;
}

/**
* Synchronous fchmod(2) - Change permissions of a file.
* @param fd A file descriptor.
* @param mode A file mode. If a string is passed, it is parsed as an octal
integer.
*/
function fchmodSync(fd: number, mode: string | number): void;

/**
* Asynchronous lchmod(2) - Change permissions of a file. Does not dereference
symbolic links.
* @param path A path to a file. If a URL is provided, it must use the `file:`
protocol.
* @param mode A file mode. If a string is passed, it is parsed as an octal
integer.
*/
function lchmod(path: PathLike, mode: string | number, callback:
NoParamCallback): void;

// NOTE: This namespace provides design-time support for util.promisify.


Exported members do not exist at runtime.
namespace lchmod {
/**
* Asynchronous lchmod(2) - Change permissions of a file. Does not
dereference symbolic links.
* @param path A path to a file. If a URL is provided, it must use the
`file:` protocol.
* @param mode A file mode. If a string is passed, it is parsed as an octal
integer.
*/
function __promisify__(path: PathLike, mode: string | number):
Promise<void>;
}

/**
* Synchronous lchmod(2) - Change permissions of a file. Does not dereference
symbolic links.
* @param path A path to a file. If a URL is provided, it must use the `file:`
protocol.
* @param mode A file mode. If a string is passed, it is parsed as an octal
integer.
*/
function lchmodSync(path: PathLike, mode: string | number): void;

You might also like