overwolf.io

Use the overwolf.io API to check if a certain file exists or to write content to a file.

For more I/O functionalities, please use our simple I/O plugin

Methods

fileExists(filePath, callback)

Version added: 0.93.1

Checks for the existance of the file in the given path.

  • Parameter: filePath <string>

    The path to check for.
  • Parameter: callback <function>

    Returns with the result.
Callback argument:
{
    "status": "success",
    "found": true
}

writeFileContents(filePath, content, encoding, triggerUacIfRequired, callback)

Version added: 0.93.1

Writes the content to the target file. If the file doesn’t exist, it will be created, along with any needed directories along the path. Otherwise, the file’s content will be overwritten.

Permissions required: FileSystem

  • Parameter: filePath <string>

    The full path of the file to write to.

  • Parameter: content <string>

    The content to write.

  • Parameter: encoding <eEncoding>

    The encoding to use, see more at eEncoding.

  • Parameter: triggerUacIfRequired <bool>

    If additional permissions are required, allows the triggering of the Windows UAC dialog.

  • Parameter: callback <function>

    Called with the status of the request.
Callback argument:
{
    "status": "success"
}

readFileContents(filePath, encoding, callback)

Version added: 0.93.1

Returns a string with the targeted file’s content.

{"status":"success","content":"Hello World!"}

If the file doesn’t exist, an error status will be returned:

{"status":"error","reason":"File doesn't exists"}

Permissions required: FileSystem

  • Parameter: filePath <String>

    The full path of the targeted file.

  • Parameter: encoding <eEncoding>

    The encoding to use, see more at eEncoding.

  • Parameter: callback <function>

    Called with the status of the request.

Callback argument:
{"status":"success","content":"Hello World!"}

copyFile(src, dst, overrideFile, reserved)

Version added: 0.102.1

Copy a file from the local extension directory to a destination in the local machine.

Permissions required: FileSystem

  • Parameter: src <string>

    A relative (to the root of your extension's folder) file path or a full overwolf-extension:// URI to the source file to be copied

  • Parameter: dst <string>

    The destination path (including filename) to copy to.

  • Parameter: overrideFile <bool>

    "true" if you want an existing file to be overriden, "false" otherwise.

  • Parameter: reserved <bool>

    For future use.

Types

eEncoding

File encoding.

Options

UTF8

UTF8BOM

Unicode

UnicodeBOM

ASCII