HolyLib Wiki

autorefresh

autorefresh

This library lets you control GMod's Lua auto refresh system, which reloads a Lua file when it changes on disk without needing to restart the server.
You can add extra files/folders to be watched, or block specific files from ever being refreshed. Supports: Linux32

Methods

boolean autorefresh.AddFileToRefresh( string fileName )
Adds a single file to the list of files that are periodically checked for changes using a background thread pool. (See holylib_autorefresh_threads)
This is separate from folder watching and is useful for watching a file that isn't inside a watched folder.
boolean autorefresh.AddFolderToRefresh( string folderName, boolean recursive = false )
Adds a folder to GMod's Lua auto refresh watcher, the same way folders configured by the engine are watched.
boolean autorefresh.BlockFileForRefresh( string filePath, boolean block )
Blocks (or unblocks) a specific file from ever being refreshed by the auto refresh system, even if it changes on disk.
autorefresh.RefreshFolders()
Re-runs GMod's auto refresh folder scan, the same scan that happens once when the server starts up.
This is useful after adding new folders to watch, to make sure they get picked up right away.
boolean autorefresh.RemoveFileFromRefresh( string fileName )
Removes a file that was previously added with autorefresh.AddFileToRefresh.
boolean autorefresh.RemoveFolderFromRefresh( string folderName, boolean recursive = false )
Removes a folder that was previously added with autorefresh.AddFolderToRefresh.