diff options
author | Alexis211 <alexis211@gmail.com> | 2009-10-23 21:06:23 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-10-23 21:06:23 +0200 |
commit | 5dd48c50c0cf7793a5dafa6be769c8a3f8b9ab60 (patch) | |
tree | 75ee8e14bf7684394a6a663c90b5c26dc5246702 /Source/Applications/Shell | |
parent | 66630e4154b7c1c47d6223fe5a8607cd269446a0 (diff) | |
download | Melon-5dd48c50c0cf7793a5dafa6be769c8a3f8b9ab60.tar.gz Melon-5dd48c50c0cf7793a5dafa6be769c8a3f8b9ab60.zip |
Added some screenshots (\o/) and implemented mkdir in userland.
Diffstat (limited to 'Source/Applications/Shell')
-rw-r--r-- | Source/Applications/Shell/Shell-fs.ns.cpp | 14 | ||||
-rw-r--r-- | Source/Applications/Shell/Shell.ns.cpp | 1 | ||||
-rw-r--r-- | Source/Applications/Shell/Shell.ns.h | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/Source/Applications/Shell/Shell-fs.ns.cpp b/Source/Applications/Shell/Shell-fs.ns.cpp index 5e6ae4f..b7e585a 100644 --- a/Source/Applications/Shell/Shell-fs.ns.cpp +++ b/Source/Applications/Shell/Shell-fs.ns.cpp @@ -15,8 +15,13 @@ void ls(Vector<String>& args) { d = n; } if (d.valid()) outvt << "Contents of directory " << d.path() << " :\n"; + if (!d.valid()) return; for (u32int i = 0; i < d.getLength(); i++) { FSNode n = d.getChild(i); + if (!n.valid()) { + outvt << " [inacessible file]\n"; //This is a file we are not supposed to be able to read + continue; + } String perm = "rwxrwxrwx"; u32int p = n.getPerm(); for (u32int i = 0; i < 9; i++) { @@ -63,4 +68,13 @@ void rm(Vector<String>& args) { } } +void mkdir(Vector<String>& args) { + if (args.size() == 1) outvt << "No directory to create.\n"; + for (u32int i = 1; i < args.size(); i++) { + if (!FS::mkdir(args[i], cwd).valid()) { + outvt << "Error while creating directory " << args[i] << "\n"; + } + } +} + } diff --git a/Source/Applications/Shell/Shell.ns.cpp b/Source/Applications/Shell/Shell.ns.cpp index 1f8acae..fe8c5f9 100644 --- a/Source/Applications/Shell/Shell.ns.cpp +++ b/Source/Applications/Shell/Shell.ns.cpp @@ -15,6 +15,7 @@ u32int run() { {"cd", cd}, {"pwd", pwd}, {"rm", rm}, + {"mkdir", mkdir}, {"", 0} }; diff --git a/Source/Applications/Shell/Shell.ns.h b/Source/Applications/Shell/Shell.ns.h index 5cf4509..56fdb46 100644 --- a/Source/Applications/Shell/Shell.ns.h +++ b/Source/Applications/Shell/Shell.ns.h @@ -11,4 +11,5 @@ namespace Shell { extern void cd(Vector<String>& args); extern void pwd(Vector<String>& args); extern void rm(Vector<String>& args); + extern void mkdir(Vector<String>& args); } |