GithubHelp home page GithubHelp logo

gm_io's Introduction

gm_io

Unlimited Garry's Mod file access!

###Credits Me - For some of the code Endless ammounts of c++ tutorials - For the rest of the code Garry Newman - For Garry's Mod and Bootil

###Release

#####Linux

  • Client - todo
  • Server - todo

#####Windows

###Reference

####io.file

--[[
  Finds files and folders from a search path.

  @param  string  search  Search path
  @return table           Files
  @return table           Folders
  @return number          Item count
]]
io.file.Find(search)

--[[
  Checks to see if a file exists.

  @param  string  path  ...
  @return bool          ...
]]
io.file.Exists(path)

--[[
  Gets all files in a folder.

  @param  string  path      Folder path
  @param  bool    recursive Recursive folder check
  @return table             Files
  @return number            Item count
]]
io.file.GetFilesInFolder(path recursive = false)

--[[
  Get file size.

  @param  string  path  File path
  @return number        File size
]]
io.file.Size(path)

--[[
  Get file contents.

  @param  string  path  File path
  @return string        File contents
]]
io.file.Read(path)

--[[
  Set file contents.

  @param  string  path  File path
  @param  string  data  File data
  @return bool          Success
]]
io.file.Write(path, data)

--[[
  Append file contents.

  @param  string  path  File path
  @param  string  data  File data
  @return bool          Success
]]
io.file.Append(path, data)

--[[
  Copy file from one location to another.

  @param  string  path_from Initial path
  @param  string  path_to   Destination path
  @return bool              Success
]]
io.file.Copy(path_from, path_to)

--[[
  Move file from one location to another.

  @param  string  path_from Initial path
  @param  string  path_to   Destination path
  @return bool              Success
]]
io.file.Move(path_from, path_to)

--[[
  Remove file.

  @param  string  path  File path
  @return bool          Success
]]
io.file.Remove(path)

--[[
  Get temporary file directory.

  @return string  Temporary directory path
]]
io.file.GetTempDir()

--[[
  Get generated temporary file path.

  @return string  Temporary file path
]]
io.file.GetTempFilename()

####io.directory

--[[
	Checks to see if a directory exists.

	@param	string	path 	Directory path
	@return	bool			Exists
]]
io.directory.Exists(path)

--[[
	Creates a directory.

	@param	string	path		Directory path
	@param	bool	recursive	Recursive directory creation
	@return bool				Success
]]
io.directory.Create(path recursive = false)

--[[
	Removes a directory.

	@param	string	path	Directory path
	@return bool			Success
]]
io.directory.Remove()

####io.watcher (unsure if this works yet)

--[[
	Adds a folder watcher.

	@param	string		name			Watcher identifier
	@param	string		path			Directory path
	@param	function	callback		Change callback
	@param	bool		watch_subtree	Watch child folders
	@return bool						Success
]]
io.watcher.Add(name, path, callback, watch_subtree = false)

--[[
	Stops a folder watcher.

	@param	string	name	Watcher identifier
]]
io.watcher.Remove(name)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.