Options
All
  • Public
  • Public/Protected
  • All
Menu

Common IO utilities

Hierarchy

  • ZosFilesUtils

Index

Properties

Static Readonly DEFAULT_FILE_EXTENSION

DEFAULT_FILE_EXTENSION: string = "txt"

Default file extension

Static Readonly DSN_SEP

DSN_SEP: string = "."

Data set name qualifier separator

Static Readonly MAX_MEMBER_LENGTH

MAX_MEMBER_LENGTH: number = 8

Methods

Static dfsmsHsmCommand

Static ensureSafeTempDir

  • ensureSafeTempDir(dir: string): void
  • Ensures a temp directory exists and is safe to use, creating it if necessary. Ownership and permissions are always verified after the creation attempt, whether or not the directory already existed, so a directory planted by another local user sharing the same tmp location is rejected.

    throws

    {ImperativeError} - when the directory exists but is not safe to use

    Parameters

    • dir: string

      the temp directory to validate or create

    Returns void

Static formatUnixFilepath

  • formatUnixFilepath(usspath: string): string

Static Private generateHeadersBasedOnOptions

Static generateMemberName

  • generateMemberName(fileName: string): string

Static getDataSetFromName

  • getDataSetFromName(name: string): IDataSet

Static getDirsFromDataSet

  • getDirsFromDataSet(dataSet: string): string
  • Break up a dataset name of either: USER.WORK.JCL(TEMPLATE) to user/work/jcl/template Or: USER.WORK.PS to user/work/ps

    throws

    {ImperativeError} - when a generated directory structure contains backtracking characters

    Parameters

    • dataSet: string

      data set to break up into folders

    Returns string

Static getFileListFromPath

  • getFileListFromPath(inputPath: string, inFullPathFormat?: boolean, isIgnoreHidden?: boolean): string[]
  • Return an array contain the list of all files in the input path. It does not trevor to directory in the input path.

    Parameters

    • inputPath: string

      input path to gather file list

    • Default value inFullPathFormat: boolean = true
    • Default value isIgnoreHidden: boolean = true

    Returns string[]

    Array of all files finds in path

Static getFullPath

  • getFullPath(inputPath: string): string

Static getUserTempToken

  • getUserTempToken(): string
  • Returns a short, filesystem-safe token that is unique per OS user, for building per-user temp directory names. Deriving the name from the user (rather than a random per-run value) keeps the path stable across invocations - so features like edit stash-resume still work - while ensuring co-tenants on a shared temp location get separate directories. The username is hashed so the token is path-safe for any username and works on every platform (numeric uids aren't available on Windows).

    Returns string

    • a hex token derived from the current OS user

Static isDataSetNameContainMasking

  • isDataSetNameContainMasking(dataSetName: string): boolean

Static normalizeNewline

  • normalizeNewline(buffer: Buffer): Buffer

Static sanitizeUssPathForRestCall

  • sanitizeUssPathForRestCall(ussPath: string): string

Generated using TypeDoc