From f2ccc0eaa3db7366787e2fa76ae52554e93b71f1 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sat, 26 Dec 2009 12:34:27 +0100 Subject: More work on the same stuff, all shell aplets are now external bins --- Source/Applications/Shell/Applets/mkdir.cpp | 17 +++++++++++++++++ Source/Applications/Shell/Applets/rm.cpp | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Source/Applications/Shell/Applets/mkdir.cpp create mode 100644 Source/Applications/Shell/Applets/rm.cpp (limited to 'Source/Applications/Shell/Applets') diff --git a/Source/Applications/Shell/Applets/mkdir.cpp b/Source/Applications/Shell/Applets/mkdir.cpp new file mode 100644 index 0000000..56908d3 --- /dev/null +++ b/Source/Applications/Shell/Applets/mkdir.cpp @@ -0,0 +1,17 @@ +#include +#include + +class mkdir : public ShellApp { + public: + mkdir() : ShellApp("mkdir", "Create a/some directory/ies") {} + int run() { + if (args.size() == 0) outvt << "Usage: mkdir [ ...]\n"; + for (u32int i = 0; i < args.size(); i++) { + if (!FS::mkdir(args[i], FS::cwdNode()).valid()) { + outvt << "Error while creating directory " << args[i] << "\n"; + } + } + } +}; + +APP(mkdir); diff --git a/Source/Applications/Shell/Applets/rm.cpp b/Source/Applications/Shell/Applets/rm.cpp new file mode 100644 index 0000000..4dbb4ed --- /dev/null +++ b/Source/Applications/Shell/Applets/rm.cpp @@ -0,0 +1,17 @@ +#include +#include + +class rm : public ShellApp { + public: + rm() : ShellApp("rm", "Remove a/some file(s)/directorie(s)") {} + int run() { + if (args.size() == 0) outvt << "Usage : rm [ ...]\n"; + for (u32int i = 0; i < args.size(); i++) { + if (!FS::find(args[i], FS::cwdNode()).remove()) { + outvt << "Error while removing file " << args[i] << "\n"; + } + } + } +}; + +APP(rm); -- cgit v1.2.3