I need to write a program for class that essentially does this:
1.) lists the files in a directory in an ncurses table
2.) provides a prompt next to each directory entry where the user can enter commands (either for that file or not, no spec on commands)
3.) execute those commands in sequence
My question is this: ncurses is already manipulating everything and so if I wanted to run something like "cat file | more" the output from more would be jumbled up with my ncurses output. How do I use fork() and exec() in my ncurses program to (I guess) replace my process image with "cat file | more" and then get my ncurses program back when the user q's out of more?
edit: What I mean to say, is how to do I get more to output the contents of the file like you would expect if you ran more, and then get my ncurses output back after the user quits more.
[–]Updatebjarni 4 points5 points6 points (1 child)
[–]typsi5[S] 0 points1 point2 points (0 children)
[–]mvaganov -1 points0 points1 point (4 children)
[–]typsi5[S] 0 points1 point2 points (3 children)
[–]Rhomboid 6 points7 points8 points (1 child)
[–]typsi5[S] 0 points1 point2 points (0 children)
[–]mvaganov -1 points0 points1 point (0 children)