Overwolf

Overwolf

  • Getting Started
  • Docs
  • API
  • Events Status
  • Blog
  • Q&A
  • Support

›overwolf.io

API Reference

  • Changelog
  • Overview

App Manifest

  • manifest.json
  • Validate your manifest

Available Game Events

  • Games IDs
  • Apex Legends
  • Call of Duty: Vanguard
  • Call of Duty: Warzone
  • CS:GO
  • Dota 2
  • Dota Underlords
  • Escape From Tarkov
  • Eternal Return
  • Final Fantasy XIV
  • Football Manager 2021
  • Football Manager 2022
  • Fortnite
  • Halo Infinite
  • Hearthstone
  • Heroes of the Storm
  • Hunt: Showdown
  • Legends of Runeterra
  • League of Legends
  • MakerKing
  • Minecraft
  • MTG Arena
  • New World
  • Overwatch
  • Path of Exile
  • PUBG
  • Rainbow Six Siege
  • Rocket League
  • StarCraft II
  • Splitgate: Arena Warfare
  • Teamfight Tactics
  • Valheim
  • Valorant
  • World of Tanks
  • World of Warcraft
  • World of Warships
  • Warframe
  • Various External APIs

Game Launchers Events

  • Launchers IDs
  • LOL Launcher

overwolf.benchmarking

  • overwolf.benchmarking

overwolf.campaigns

  • overwolf.campaigns.crossapp

overwolf.cryptography

  • overwolf.cryptography

overwolf.extensions

  • overwolf.extensions
  • overwolf.extensions.current
  • overwolf.extensions.sharedData
  • overwolf.extensions.io

overwolf.games

  • overwolf.games
  • overwolf.games.events
  • overwolf.games.tracked
  • overwolf.games.inputTracking
  • overwolf.games.launchers
  • overwolf.games.launchers.events

overwolf.io

  • overwolf.io
  • overwolf.io.paths

overwolf.logitech

  • overwolf.logitech
  • overwolf.logitech.arx
  • overwolf.logitech.led

overwolf.media

  • overwolf.media
  • overwolf.media.audio
  • overwolf.media.replays
  • overwolf.media.videos
  • Highlights supported games

overwolf.notifications

  • overwolf.notifications

overwolf.os

  • overwolf.os
  • overwolf.os.tray

overwolf.profile

  • overwolf.profile
  • overwolf.profile.subscriptions
  • overwolf.profile.subscriptions.inapp

overwolf.settings

  • overwolf.settings
  • overwolf.settings.hotkeys
  • overwolf.settings.language
  • overwolf.settings.games

overwolf.social

  • overwolf.social
  • overwolf.social.reddit
  • overwolf.social.youtube
  • overwolf.social.discord
  • overwolf.social.gfycat
  • overwolf.social.twitter

overwolf.streaming

  • overwolf.streaming

overwolf.tobii

  • overwolf.tobii

overwolf.utils

  • overwolf.utils

overwolf.web

  • overwolf.web
  • overwolf.web.webserver
  • overwolf.web.websocket

overwolf.windows

  • overwolf.windows
Edit

overwolf.io API

Check whether a certain file exists and/or to write content into files.

tip

For app-related I/O functionalities, use the overwolf.extensions.io API.

In addition, the simple I/O plugin offers several more general I/O features that are not available through the APIs.

Methods Reference

  • overwolf.io.fileExists()
  • overwolf.io.writeFileContents()
  • overwolf.io.readFileContents()
  • overwolf.io.copyFile()
  • overwolf.io.dir()
  • overwolf.io.readBinaryFile()
  • overwolf.io.readTextFile()
  • overwolf.io.exist()
  • overwolf.io.listenOnFile()
  • overwolf.io.stopFileListener()

Types Reference

  • overwolf.io.enums.eEncoding enum
  • overwolf.io.enums.encoding enum
  • overwolf.io.enums.fileListenerState enum
  • overwolf.io.ReadFileOptions Object
  • overwolf.io.ListenFileOptions Object
  • overwolf.io.DirResult Object
  • overwolf.io.FileExistsResult Object
  • overwolf.io.ReadFileContentsResult Object
  • overwolf.io.ListenOnFileResult Object
  • overwolf.io.ExistsResult Object
  • overwolf.io.ReadBinaryFileResult Object
  • overwolf.io.ReadTextFileResult Object
  • overwolf.io.FileInfo Object
  • overwolf.io.FileInDir Object

Sample app

In our APIs sample apps repository, you can find and download a sample app that demonstrates the usage in the IO API:

  • The io-sample - Demonstrates how to open and load a file to your app, Display it, Add some content, and Write it back to the file.

It's a great place to get started - All the samples in this repository are built with JS code and demonstrate primary usage in the API.

fileExists(filePath, callback)

Version added: 0.93

Checks for the existence of a file in a given path.

ParameterTypeDescription
filePathstringPath to check for
callbackfunctionReturns the result
callback(Result: FileExistsResult) => voidReturns with the result

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

Version added: 0.93

Permissions required: FileSystem

Writes content into a target text file.

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

ParameterTypeDescription
filePathstringPath to check for
contentstringContent to write
encodingeEncoding enumEncoding to use
triggerUacIfRequiredboolIf additional permissions are required, triggers the Windows UAC dialog
callback(Result) => voidReturns with the result

readFileContents(filePath,encoding, callback)

Version added: 0.93

Permissions required: FileSystem

Returns a string with the targeted text file’s content.

ParameterTypeDescription
filePathstringFull path of the targeted file
encodingeEncoding enumEncoding to use
callback(Result: ReadFileContentsResult) => voidReturns the result

copyFile(src, dst, overrideFile, reserved, callback)

Version added: 0.93

Permissions required: FileSystem

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

ParameterTypeDescription
srcstringA relative file path from your extension's root folder, or a full overwolf-extension:// URI to the source file
dststringDestination absolute path to copy to including filename. See usage example below
overrideFilebool"true" if you want an existing file to be overwritten, "false" otherwise
reservedboolFor future use
callback(Result) => voidReturns with the result

Usage example

overwolf.io.copyFile("Fortnite Battle Royale 03-19-2020 14-10-18-457.mp4","C:/Users/Hal9000/AppData/Local/Overwolf/Extensions/nhmkaollkcmjiecdnnjmgfifjgkfegkljnjjbipp/1.0.18/copy.mp4",false,false,console.log)

dir(path, callback)

Version added: 0.141

Permissions required: FileSystem

Lists all files and folder in the target path.

ParameterTypeDescription
pathstringThe target path
callback(Result: DirResult) => voidReturns with the result

Usage example

overwolf.io.dir("C:/Users/Hal9000/Videos/Overwolf",console.log)

readBinaryFile(path, options, callback)

Version added: 0.141

Permissions required: FileSystem

Read binary file.

Reads a file's contents and returns an array of byte values.
This function is extremely slow! Use it only for small files or to get file header info using the options parameter (maxBytesToRead) to limit the amount of data to fetch.

ParameterTypeDescription
pathstringThe target path
optionsReadFileOptions object
callback(Result: ReadBinaryFileResult) => voidReturns with the result

readTextFile(path, options, callback)

Version added: 0.141

Permissions required: FileSystem

Read text file.

Reads a file's contents and returns it as text.

ParameterTypeDescription
pathstringThe target path
optionsReadFileOptions object
callback(Result: ReadTextFileResult) => voidReturns with the result

exist(path, callback)

Version added: 0.141

Permissions required: FileSystem

Is path exist.

ParameterTypeDescription
pathstringThe target path
callback(Result: ExistsResult) => voidReturns with the result

listenOnFile(id, path, option, callback)

Version added: 0.141

Permissions required: FileSystem

Start listening on file.

Stream a file (text files only), line-by-line, from the local filesystem.

ParameterTypeDescription
idstringlisten Id
pathstringfile path
optionsListenFileOptions Object
callback(Result: ListenOnFileResult) => voidReturns with the result

Usage example

overwolf.io.listenOnFile('test.txt','C:\\test\\test.txt', {},console.log)

stopFileListener(id)

Version added: 0.141

Permissions required: FileSystem

Stop listening on file.

Stop streaming a file that you previously passed when calling listenOnFile.
There are no callbacks - as this will never fail (even if the stream doesn't exist).

ParameterTypeDescription
idstringlisten Id

stopFileListener notes

On stop, listenOnFile callback will trigger with a "truncated" state:

{
    "success" : true, 
    "error": "", 
    "state": "truncated" 
    ...
}

fileListenerState enum

File listener state.

Options
started
running
terminated
truncated

encoding enum

encoding types.

Options
Default
UTF8
UTF32
Unicode
UTF7
ASCII
BigEndianUnicode

eEncoding enum

File encoding.

Options
UTF8
UTF8BOM
Unicode
UnicodeBOM
ASCII

ReadFileOptions Object

Version added: 0.141

Describes the different options to read a file.

ParameterTypeDescription
encodingeEncoding enum
maxBytesToReadintdefault is 0 => read all file
offsetintstart reading point, default is 0

ListenFileOptions Object

Version added: 0.141

Describes the different options to listen to a file.

ParameterTypeDescription
skipToEndboolshould skip directly to end of file. default if false
encodingencoding enumEncoding to use. Default is is the default value

DirResult Object

Version added: 0.141

List of files and folders.

ParameterTypeDescription
successbooleanInherited from the "Result" Object
errorstringInherited from the "Result" Object
dataFileInDir[]List of files and folders

Example data

{
   "success":true,
   "path":"C:/Users/Hal9000/Videos/Overwolf",
   "data":[
      {
         "name":"Fortnite 03-19-2020 17-15-56-087.mp4",
         "type":"file"
      },
      {
         "name":"Game Events Simulator",
         "type":"dir"
      },
      {
         "name":"Game Summary",
         "type":"dir"
      }

   ]
}

FileExistsResult Object

Version added: 0.141

The result.

ParameterTypeDescription
successbooleanInherited from the "Result" Object
errorstringInherited from the "Result" Object
foundbooleanReturn if the file exist or not

Example data

{
   "success":true,
   "found":true
}

ReadFileContentsResult Object

Version added: 0.141

the status of the request and the file contect.

ParameterTypeDescription
successbooleanInherited from the "Result" Object
errorstringInherited from the "Result" Object
contentstringstring with the taraget file’s content

Example data

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

ListenOnFileResult Object

Version added: 0.141

The result.

ParameterTypeDescription
successbooleanInherited from the "Result" Object
errorstringInherited from the "Result" Object
statestringCurrent callback state. Only valid only when "success" is true overwolf.io.enums.fileListenerState
contentstringstring with the taraget line content

Example data

{
    "success" : true, // when false the callback will stop listen
    "error": "", // valid only when success = false
    "state": "started|running|terminated|truncated", // valid only when success =true (overwolf.io.enums.fileListenerState) 
    "content": "" //the line  
}

notes

  • "state" is from type overwolf.io.enums.fileListenerState.
  • Please read what happens when you call stopFileListener().

ExistsResult Object

Version added: 0.141

The result.

ParameterTypeDescription
successbooleanInherited from the "Result" Object
errorstringInherited from the "Result" Object
existbooleanReturn if the file exist or not

Example data

{
   "success":true,
   "exist":true
}

ReadBinaryFileResult Object

Version added: 0.141

The result.

ParameterTypeDescription
successbooleanInherited from the "Result" Object
errorstringInherited from the "Result" Object
contentstringReturn with the file content
infoFileInfo objectReturn with the file content

Example data

 {
    "success" : true,
    "error": "", 
    "content": byte[], // the file content in bytes
    "info" : {
        "eof" : true, // is EOF
        "totalRead" : 3000, // total read bytes
        "position" : 3000, // last file position
        "totalLines" :100, // total read lines
    }
}

ReadTextFileResult Object

Version added: 0.141

The result.

ParameterTypeDescription
successbooleanInherited from the "Result" Object
errorstringInherited from the "Result" Object
contentstringReturn with the file content
infoFileInfo objectReturn with the file content

Example data

 {
    "success" : true,
    "error": "", 
    "content": byte[], // the file content in bytes
    "info" : {
        "eof" : true, // is EOF
        "totalRead" : 3000, // total read bytes
        "position" : 3000, // last file position
        "totalLines" :100, // total read lines
    }
}

FileInfo Object

Version added: 0.141

Container for the file info properties.

ParameterTypeDescription
successbooleanInherited from the "Result" Object
errorstringInherited from the "Result" Object
eofboolean
totalReadnumber
positionnumber
totalLinesnumber

FileInDir Object

Version added: 0.141

Container for the list of files and folders in a directory.

ParameterTypeDescription
successbooleanInherited from the "Result" Object
errorstringInherited from the "Result" Object
namestring
typestring

Example data

{
   "name":"Fortnite 03-19-2020 17-15-56-087.mp4",
   "type":"file"
}
Last updated on 1/25/2022 by eransharv
← overwolf.games.launchers.eventsoverwolf.io.paths →
  • Methods Reference
  • Types Reference
  • Sample app
  • fileExists(filePath, callback)
  • writeFileContents(filePath, content, encoding, triggerUacIfRequired, callback)
  • readFileContents(filePath,encoding, callback)
  • copyFile(src, dst, overrideFile, reserved, callback)
  • dir(path, callback)
  • readBinaryFile(path, options, callback)
  • readTextFile(path, options, callback)
  • exist(path, callback)
  • listenOnFile(id, path, option, callback)
  • stopFileListener(id)
  • fileListenerState enum
  • encoding enum
  • eEncoding enum
  • ReadFileOptions Object
  • ListenFileOptions Object
  • DirResult Object
  • FileExistsResult Object
  • ReadFileContentsResult Object
  • ListenOnFileResult Object
  • ExistsResult Object
  • ReadBinaryFileResult Object
  • ReadTextFileResult Object
  • FileInfo Object
  • FileInDir Object
  • Legal
    • Terms overview
    • Developer's terms
    • App terms
    • Overwolf terms
    • Overwolf Privacy policy
  • Support
    • Questions and Answers
    • Discord
    • Slack
    • Facebook
    • Twitter
  • Documentation
    • Changelog
    • API
    • App Creation Process
    • Best Practices
    • Game Events status
  • Information
    • Careers
    • Fund
    • Developers Blog
    • Overwolf Appstore
    • Advertise on Overwolf
Overwolf 2022