Thanks!
for example I have tried the code below to get the current directory:
Code:
#define FALSE 0
#define TRUE !FALSE
extern int alphasort();
char pathname[MAXPATHLEN];
main() {
int count, i;
struct direct **files;
int file_select();
getwd(pathname);
printf("Current Working Directory = %s\n", pathname);
count = scandir(pathname, &files, file_select, alphasort);
/* If no files found, make a non-selectable menu item */
}
int file_select(struct direct *entry)
{
if ((strcmp(entry->d_name, ".") == 0) ||
(strcmp(entry->d_name, "..") == 0))
return (FALSE);
else
return (TRUE);
}
it works without any problem.
So I'm looking to do something same with "echo" and "rm"...
Any ideas??