File permission extension?

So… I would like to see if it’s possible to make a file permissions extension.

What problem(s) would this Extension solve?
This extension would solve the problem of having to use CHMOD to change file permissions, which I cannot really understand how to use.

Explain what you were trying to do when you came across the problem
Sometimes I create files that are meant to be executed, but by default, don’t have the permissions. I don’t know how to use CHMOD so I tried to use SUDO, but sudo never works on Replit.

1 Like

Currently, extensions aren’t able to change file permissions IIRC.

2 Likes

You can use chmod as a non-root user… Also, sudo is not a substitute for knowing how to use a tool.

This wiki might help: command line for absolute beginners | tilde.team~wiki

3 Likes

I know. I just don’t know how to use CHMOD so I use sudo to run the command as super user. If only Replit had a UI for editing file permissions.

1 Like

As @9pfs1 has stated, sudo isn’t a replacement for knowing how to use a command.
I suggest learning it online or looking for a cheat sheet.

2 Likes

Anyways, even if it was, you can’t do anything as root on replit. That is by no means a substantial restriction, because you can install nearly anything either using chmod or from source.

sudo is useless on replit, because it will never work correctly. Also, before you start using things as root, you should first figure out how to use them without root privileges

That wiki explains how chmod works (it explains it far better than I could)

4 Likes

I do know that, after trying several times. Some commands like APT though only work with Sudo for some reason, because some file in the system doesn’t have correct permissions.

1 Like

The permissions are correct, the method of installation isn’t. Packages are supposed to be installed using nix in repls.

3 Likes

Actually, I thought it was the file permissions being wrong, but actually it was that the file didn’t even exist!

Also, about extensions again, if extensions can run terminal commands, then a file permission extension is possible.

1 Like

About extensions again, if extensions can run terminal commands, then a file permission extension is possible.

Even if I knew how to use CHMOD, I am most used to using a UI to change file permissions.

1 Like

Why not just learn to use chmod?

3 Likes

Yes, but is it possible to run terminal commands in extensions for other things?

1 Like

Life isn’t always going to give you a UI. The sooner you learn to do things without, the better off you’ll be later on.

Not at the moment afaik.

5 Likes

I like the idea, I’ll try to have the extension done by this evening.

3 Likes

I thought we didn’t have the ability to change file permissions. Wouldn’t you have to use GraphQL, crosis, or something?

2 Likes

There are ways to do it.

Working on it: https://file-permissions-extension.luisafk.repl.co

1 Like

I didn’t say there wasn’t. I said I didn’t think it was possible with the current official extensions API. What’s your current idea?

2 Likes

Well I nearly got it to work but now that they’re about to add the exec API I’ll just wait. But it would have been similar to by shell commands lib but special for file perms.

1 Like

When it comes out, I could probably make it myself, but thank you still! :slight_smile:

1 Like