Garry's Mod Wiki


file.AsyncRead( string fileName, string gamePath, function callback, boolean sync = false )

Just Added

This was just added in the latest version (2021.03.31). It might only be available on the Dev Branch right now.


Returns the content of a file asynchronously.

All limitations of file.Read also apply.


1 string fileName
The name of the file.
2 string gamePath
The path to look for the files and directories in. See this list for a list of valid paths.
3 function callback
A callback function that will be called when the file read operation finishes. Arguments are:

  • string fileName - The fileName argument above.
  • string gamePath - The gamePath argument above.
  • number status - The status of the operation.
  • string data - The entirety of the data of the file.
4 boolean sync = false
If true the file will be read synchronously.

Page Links

Special Pages



Render Time: 64ms

DB GetPage 40
Generate Html 8
SaveChanges (1) 8
Render Body 0
Render Sidebar 6