Interface nsINativeOSFileInternalsServiceType

A service providing native implementations of some of the features of OS.File.

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Implementation of OS.File.read

    Parameters

    • path: string

      The absolute path to the file to read.

    • options: any

      An object that may contain some of the following fields

      • {number} bytes The maximal number of bytes to read.
      • {string} encoding If provided, return the result as a string, decoded using this encoding. Otherwise, pass the result as an ArrayBuffer. Invalid encodings cause onError to be called with the platform-specific "invalid argument" constant.
      • {string} compression Unimplemented at the moment.
    • onSuccess: nsINativeOSFileSuccessCallback

      The success callback.

    • onError: nsINativeOSFileErrorCallback

      The error callback.

    Returns void

  • Implementation of OS.File.writeAtomic

    Parameters

    • path: string

      the absolute path of the file to write to.

    • buffer: any

      the data as an array buffer to be written to the file.

    • options: any

      An object that may contain the following fields

      • {number} bytes If provided, the number of bytes written is equal to this. The default value is the size of the |buffer|.
      • {string} tmpPath If provided and not null, first write to this path, and move to |path| after writing.
      • {string} backupPath if provided, backup file at |path| to this path before overwriting it.
      • {bool} flush if provided and true, flush the contents of the buffer after writing. This is slower, but safer.
      • {bool} noOverwrite if provided and true, do not write if a file already exists at |path|.
    • onSuccess: nsINativeOSFileSuccessCallback

      The success callback.

    • onError: nsINativeOSFileErrorCallback

      The error callback.

    Returns void

Generated using TypeDoc