Update contrib.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
16 * Simple Directory Lister, from the GNU C help file
25 #include <sys/types.h>
37 while (ep = readdir (dp))
42 puts ("Couldn't open the directory.");
47 @SYMTestCaseID SYSLIB-STDLIB-CT-1114
48 @SYMTestCaseDesc Tests for command shell behaviour
50 @SYMTestActions Tests for command shell behaviour
51 @SYMTestExpectedResults Test must not fail
54 /* A silly shell-like thing */
56 #include <stdlib.h> /* definition of exit() */
61 #include <unistd.h> /* for getcwd */
62 #include <sys/stat.h> /* for mkdir */
64 int main(int argc, char*argv[])
67 char path[MAXPATHLEN+1];
72 printf("%s> ", getcwd(path,sizeof(path)));
73 x = scanf("%80s%s", cmd, path);
81 if (strcmp(cmd,"exit")==0)
84 if (strcmp(cmd,"ver")==0)
86 printf("DOS version 3.30\n");
90 if (strcmp(cmd,"dir")==0)
96 if (strcmp(cmd,"date")==0)
99 printf("%s",ctime(&now));
103 if (strcmp(cmd,"cd")==0)
106 if (strcmp(cmd,"mkdir")==0)
107 x = mkdir(path, 0x777);
109 if (strcmp(cmd,"rmdir")==0)
113 printf("Unrecognised command >%s<\n", cmd);