mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 07:18:38 +02:00
MISC: Add file metadata (timestamps) (#2199)
This commit is contained in:
27
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
27
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -4,6 +4,20 @@
|
||||
type _ValueOf<T> = T[keyof T];
|
||||
|
||||
/** All netscript definitions */
|
||||
|
||||
/**
|
||||
* Metadata of a file
|
||||
* @public
|
||||
*/
|
||||
interface FileMetadata {
|
||||
/** Time of Access */
|
||||
atime: number;
|
||||
/** Time of Modification */
|
||||
mtime: number;
|
||||
/** Time of Birth (creation) */
|
||||
btime: number;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
interface HP {
|
||||
current: number;
|
||||
@@ -7708,6 +7722,19 @@ export interface NS {
|
||||
*/
|
||||
read(filename: string): string;
|
||||
|
||||
/**
|
||||
* Get the metadata of a file.
|
||||
* @remarks
|
||||
* RAM cost: 0 GB
|
||||
*
|
||||
* This function returns the metadata associated with the specified file.
|
||||
*
|
||||
* @param filename - Name of the file to read the metadata from. It must be a text file (.txt, .json) or a script
|
||||
* (.js, .jsx, .ts, .tsx).
|
||||
* @Returns The metadata of the file.
|
||||
*/
|
||||
getFileMetadata(filename: string): FileMetadata;
|
||||
|
||||
/**
|
||||
* Get a copy of the data from a port without popping it.
|
||||
* @remarks
|
||||
|
||||
Reference in New Issue
Block a user