Replace lsdir system call by readdir, isdir system calls,
[pintos-anon] / src / examples / shell.c
index d31eb3a9a67c534199f0731165295e0a117b1b7e..0aaafbb91c672454d139e498af792f4084e51feb 100644 (file)
@@ -21,6 +21,11 @@ main (void)
       /* Execute command. */
       if (!strcmp (command, "exit"))
         break;
+      else if (!memcmp (command, "cd ", 3)) 
+        {
+          if (!chdir (command + 3))
+            printf ("\"%s\": chdir failed\n", command + 3);
+        }
       else if (command[0] == '\0') 
         {
           /* Empty command. */