Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
Memelord420

File extensions?

Question

So as of writing this, I only know of one file extension that actually means something in OC, which would be .lua

But I'd like to make more file extensions, would there be a way to do this? My end goal is to make it so that if you try to edit something with a certain file extension it won't let you, and maybe also be able to run it without typing the extension, like you can with lua files.

Could anyone point me in the right direction?

Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
On 11/15/2017 at 5:33 PM, rougeminner said:

LiEwYe is correct on this one, you would have to modify, or create, a new shell for OpenOS. If you were trying to prevent modification, that would have to be done by editing the "edit" function in /bin. As far as colour for file extensions goes, I believe that is define in /home/.shrc.

.shrc just runs whatever commands when sh.lua is started (in most cases, at boot)

(shell run command)

File color, when you do ls, is defined in /bin/ls.lua (which is what is ran when you do ls)

Link to post
Share on other sites
  • 0
On 11/5/2017 at 2:16 PM, Memelord420 said:

So as of writing this, I only know of one file extension that actually means something in OC, which would be .lua

But I'd like to make more file extensions, would there be a way to do this? My end goal is to make it so that if you try to edit something with a certain file extension it won't let you, and maybe also be able to run it without typing the extension, like you can with lua files.

Could anyone point me in the right direction?

as far as i know, file extentions just straight up don't matter. Even if you have none, you can still run the file as a lua file.

Running "hello" will check for a file named  "hello", and if it isn't there, it then checks for one called "hello.lua". I think you can change this in /lib/shell.lua (or /lib/core/full_shell.lua, can't remember exactly), it would be in the shell.execute function

 

Also, sorry for replying 7 years late

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.