diff options
| author | James Barnett <noreply@jamesbarnett.xyz> | 2019-10-06 18:39:36 +0100 |
|---|---|---|
| committer | James Barnett <noreply@jamesbarnett.xyz> | 2019-10-06 18:39:36 +0100 |
| commit | 29478baf24532391cd94bd08d94cf867dee976e6 (patch) | |
| tree | 3127ae32572cd262c7283c6223b6e5712a07f91d /os/commands/files.c | |
| parent | e77b371fb0fc4e62fa727a340b2e322fa60ebcff (diff) | |
| download | tinyOS-29478baf24532391cd94bd08d94cf867dee976e6.tar.xz tinyOS-29478baf24532391cd94bd08d94cf867dee976e6.zip | |
Diffstat (limited to 'os/commands/files.c')
| -rw-r--r-- | os/commands/files.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/os/commands/files.c b/os/commands/files.c new file mode 100644 index 0000000..6f23e34 --- /dev/null +++ b/os/commands/files.c @@ -0,0 +1,20 @@ +#include "../../kernel/gpu/text_mode/display.h" +#include "../filesystem/ramfs.h" + +void cmd_cf(char *args) { + // todo check args, filname length etc + ramfs_create_file(args); + scrn_print("created file: "); + scrn_println(args); +} + +void cmd_lf(char *args) { + scrn_println("files:"); + File_t* files = ramfs_list_files(); + + for(int i = 0; i <= ramfs_get_tip_file_idx(); i++) { + scrn_print(files[i].name); + scrn_print(" "); + } + scrn_newline(); +} |