API0.1.1
    Preparing search index...

    Class Ext4

    Index
    blockSize: number
    blocksPerGroup: number
    disk: Disk
    groups: Group[]
    inodeSize: number
    inodesPerGroup: number
    sb: Uint8Array
    • get blocksCount(): number

      Returns number

    • get compat(): number

      Returns number

    • get firstDataBlock(): number

      Returns number

    • get firstIno(): number

      Returns number

    • get freeBlocks(): number

      Returns number

    • get freeInodes(): number

      Returns number

    • get groupCount(): number

      Returns number

    • get incompat(): number

      Returns number

    • get inodesCount(): number

      Returns number

    • get roCompat(): number

      Returns number

    • Internal

      Allocates count blocks, as few runs as it can, starting the search near goal.

      Parameters

      • count: number
      • goal: number

      Returns Promise<{ count: number; start: number }[]>

    • Parameters

      • path: string

      Returns Promise<boolean>

    • The inode's mapping: logical runs to physical blocks, and the tree's own blocks.

      Parameters

      Returns Promise<{ runs: Run[]; tree: number[] }>

    • Writes back everything changed: bitmaps, descriptors, the superblock. Call when done.

      Returns Promise<void>

    • e.g. "security.selinux" → the value, or undefined.

      Parameters

      • path: string
      • fullName: string

      Returns Promise<Uint8Array<ArrayBufferLike> | undefined>

    • Parameters

      • ino: number

      Returns Promise<Inode>

    • The SELinux label without its trailing NUL, e.g. u:object_r:system_file:s0.

      Parameters

      • path: string

      Returns Promise<string | undefined>

    • Creates a directory. Its parent must exist; it must not.

      Parameters

      • path: string
      • attrs: Attrs

      Returns Promise<number>

    • Creates the directories on path that don't exist yet, each with attrs.

      Parameters

      • path: string
      • attrs: Attrs

      Returns Promise<void>

    • Parameters

      Returns Promise<void>

    • Parameters

      • path: string

      Returns Promise<DirEntry[]>

    • Parameters

      • path: string

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Parameters

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Removes a file, symlink or (with recursive, or when empty) directory.

      Parameters

      • path: string
      • Optionalo: { checked?: boolean; recursive?: boolean; time?: number }

      Returns Promise<void>

    • Replaces a file's contents, keeping its owner, mode and every xattr (the label, security.capability, …).

      Parameters

      • path: string
      • data: Uint8Array
      • Optionaltime: number

      Returns Promise<void>

    • The inode at path ("/" is the filesystem's root). Throws if it doesn't exist.

      Parameters

      • path: string

      Returns Promise<number>

    • Internal

      Points the inode at runs (sorted, logical from 0), with a leaf block when they don't fit in it. Returns the tree's block count.

      Parameters

      • n: Inode
      • runs: Run[]
      • goal: number

      Returns Promise<number>

    • Sets the SELinux label of an existing file (in the inode).

      Parameters

      • path: string
      • label: string

      Returns Promise<void>

    • Parameters

      • path: string

      Returns Promise<Stat>

    • Creates a regular file with data. Its parent must exist; it must not.

      Parameters

      • path: string
      • data: Uint8Array
      • attrs: Attrs

      Returns Promise<number>

    • Internal

      Rewrites the inode's in-inode xattrs as list. Throws if they don't fit (no xattr blocks are written).

      Parameters

      Returns void

    • Internal

      The inode's xattrs in a block of their own (EXT4_XATTR_MAGIC, refcount 1): entries sorted as the kernel searches them (index, name length, name), values from the end, with the entry and block hashes e2fsck checks. Adds the block to i_file_acl and i_blocks.

      Parameters

      Returns Promise<void>

    • Opens the ext4 on disk. Throws for a filesystem this package can't change safely.

      Parameters

      Returns Promise<Ext4>