Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Inode

Generic inode definition that can easily be serialized. Generic interface for file/directory inodes. Note that Stats objects are what we use for file inodes.

Hierarchy

  • Inode

Index

Constructors

constructor

  • new Inode(id: string, size: number, mode: number, atime: number, mtime: number, ctime: number): Inode
  • Parameters

    • id: string
    • size: number
    • mode: number
    • atime: number
    • mtime: number
    • ctime: number

    Returns Inode

Properties

atime

atime: number

ctime

ctime: number

id

id: string

mode

mode: number

mtime

mtime: number

size

size: number

Methods

getSize

  • getSize(): number

isDirectory

  • isDirectory(): boolean

isFile

  • isFile(): boolean

toBuffer

  • toBuffer(buff?: Buffer): Buffer
  • Writes the inode into the start of the buffer.

    Parameters

    • Default value buff: Buffer = Buffer.alloc(this.getSize())

    Returns Buffer

toStats

update

  • update(stats: Stats): boolean
  • Updates the Inode using information from the stats object. Used by file systems at sync time, e.g.:

    • Program opens file and gets a File object.
    • Program mutates file. File object is responsible for maintaining metadata changes locally -- typically in a Stats object.
    • Program closes file. File object's metadata changes are synced with the file system.

    Parameters

    Returns boolean

    True if any changes have occurred.

Static fromBuffer

  • fromBuffer(buffer: Buffer): Inode

Static isDir

  • isDir(): boolean

Static isFile

  • isFile(): boolean

Generated using TypeDoc