Posted 01 April 2012 - 10:35 AM
This is a new API I made, and I think it's pretty useful. It allows you to manipulate files easily.
Function List
Installation
Unzip the zip file that comes with this topic.
Put the rom folder in mods/Computercraft/lua/rom
Put the bios.lua in mods/Computercraft/lua
Downloads
Flib v1.2
Flib v1.0
Function List
Spoiler
exists(path) --Returns true if the file exists
getTable(path) --Returns a table with all the lines
getLine(path, n) --Returns the nth line
getText(path) --Returns the text
fappend(path, text) --Appends to a file
fwrite(path, text) --Writes to a file
fwriteAtStart(path, text) --Writes at the start of the file
fwriteFromTable(path, t) --Writes a file with each field in t as a line
fappendFromTable(path, t) --Appends to a file with each field in t as a line
fwriteAtStartFromTable(path, t) --Writes at the start of a file with each field in t as a line
replaceLine(path, n, text) --Will replace the nth line in file with text
getName(path) --Returns the filename of the file(Without the path)
getPath(path) --Returns the path only(Not the filename)
fremove(path) --Removes a file/dir
Installation
Spoiler
Unzip the zip file that comes with this topic.
Put the rom folder in mods/Computercraft/lua/rom
Put the bios.lua in mods/Computercraft/lua
Downloads
Spoiler
Flib v1.2
Flib v1.0