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

[Discontinued] File Extension Mod

Started by inventor2514, 19 March 2012 - 10:56 PM
inventor2514 #1
Posted 19 March 2012 - 11:56 PM
Description
This mod adds file extensions to ComputerCraft. The advantage of extensions is that types of files can be identified by programs so that they do not attempt to use files they are not designed for. Three file extensions are included: .lua for programs, .txt for text files, and .api for APIs. More extensions can be added using the file extension API (ext.api). The API also includes other functions that allow programs to manipulate file extensions:

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.

Note that most non-core files must be renamed with an appropriate extension for them to work. If you define an extension for use with one of your programs, please post it on this thread so extensions can be standardized.

The mod can be downloaded with the link below; just press Ctrl+S.
https://docs.google....1SGdZSWxlR3M0QQ


Features
- Most core files were renamed to include an extension
- The os.loadAPI function requires a .api extension
- The run command always assumes an extension of .lua
- The edit command defaults to an extension of .lua
- The type command recognizes defined file extensions
- A file extension API and a corresponding help file were added
Ian-Moone #2
Posted 21 March 2012 - 12:04 PM
i can see were dotsonface is coming from but i do think this makes cc pc's more realistic and if there more realistic then we can do more right?
Robd #3
Posted 05 April 2012 - 03:19 AM
It's more of a simplicity than functionality mod in my opinnion. I think it'd really just be a matter of preference
jcc10 #4
Posted 16 July 2012 - 12:16 AM
Heay could you fix the download link… it broke
inventor2514 #5
Posted 16 July 2012 - 01:12 AM
Sorry, I no longer have the files. I posted this a while ago but abandoned it due to the lack of community interest at the time.
jcc10 #6
Posted 16 July 2012 - 06:27 PM
aww… It helped so much when editing the files in Notepad++… Oh well…
rex41043 #7
Posted 19 July 2012 - 08:14 PM
I wish this API was still running :P/>/>
inventor2514 #8
Posted 19 July 2012 - 09:21 PM
aww… It helped so much when editing the files in Notepad++… Oh well…
I wish this API was still running :P/>/>

I've got some good new for you. I just recreated the API and posted it!
http://www.computercraft.info/forums2/index.php?/topic/2716-extension-api/
rex41043 #9
Posted 20 July 2012 - 10:01 AM
aww… It helped so much when editing the files in Notepad++… Oh well…
I wish this API was still running :)/>/>

I've got some good new for you. I just recreated the API and posted it!
http://www.computerc...-extension-api/
YAY thanx :P/>/>