SnowflakeOS icon indicating copy to clipboard operation
SnowflakeOS copied to clipboard

Implement more utility commands like cat, mkdir etc...

Open 29jm opened this issue 5 years ago • 5 comments

On top of my head, the following are missing and could be implemented with the functions available in the libc right now:

  • cat
  • cd (this one should be implemented in the terminal app, not as a standalone program)
  • tree (in fact it's already implemented in test.c, but not in a useful form)
  • rm
  • grep

29jm avatar Nov 22 '20 16:11 29jm

I will give a shot at cat and rm might make for a fun challenge

xadaemon avatar Dec 20 '20 07:12 xadaemon

@octetd actually I added a basic cat a few commits ago, but it doesn't support multiple files, e.g. cat file1 file2, maybe you could add that? As for rm I added an unlink program that literally just calls unlink (the system call), but It'd be cool to have a more proper rm, with support for its -r option.

The current unlink system call won't delete folders though, not even empty ones. I'll add an rmdir syscall, you can assume you have it (from unistd.h, see man 3 rmdir) in the mean time if you start before I push it.

29jm avatar Dec 20 '20 10:12 29jm

I will hold on until you push that then and give priority to #15

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Sunday, December 20th, 2020 at 07:17, Johan Manuel [email protected] wrote:

@octetd actually I added a basic cat a few commits ago, but it doesn't support multiple files, e.g. cat file1 file2, maybe you could add that? As for rm I added an unlink program that literally just calls unlink (the system call), but It'd be cool to have a more proper rm, with support for its -r option.

The current unlink system call won't delete folders though, not even empty ones. I'll add an rmdir syscall, you can assume you have it (from unistd.h, see man 3 rmdir) in the mean time if you start before I push it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

xadaemon avatar Dec 20 '20 14:12 xadaemon

I will try implementing cd.

GandelXIV avatar Apr 05 '22 18:04 GandelXIV

I will try implementing cd.

Excellent, let me know if I can help with anything.

29jm avatar Apr 05 '22 21:04 29jm