This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
inventor2514's profile picture

Extension API

Started by inventor2514, 19 July 2012 - 07:18 PM
inventor2514 #1
Posted 19 July 2012 - 09:18 PM
Description
This API offers some simple functions to manage file extensions. Some of you may remember this from my discontinued File Extension Mod. I figured I could at least recreate the API, and I even improved it a bit.

Functions
Spoilerext.get(sName) – returns extension or nil
ext.has(sName, sExt*) – returns boolean
ext.hide(sName) – returns sName without extension
ext.put(sName, sExt) – returns sName with extension sExt
ext.type(sName) – returns type as string
ext.define(sExt,sType) – returns boolean indicating success
ext.defined(sExt) – returns boolean and type if true
* = optional

Defined types are reset upon shutdown, so including definitions in a startup program is recommended.

Download
http://pastebin.com/zHh4y7c9
or "pastebin get zHh4y7c9 ext"
Favorlock #2
Posted 21 November 2012 - 04:06 AM
Thumbs Up! I hope you plan to continue working on this.