Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!sri-unix!husc6!necntc!ames!ucbcad!ucbvax!jade!beryl.berkeley.edu!marcp From: marcp@beryl.berkeley.edu.UUCP Newsgroups: comp.unix.questions Subject: A couple questions Message-ID: <3164@jade.BERKELEY.EDU> Date: Tue, 14-Apr-87 03:13:42 EST Article-I.D.: jade.3164 Posted: Tue Apr 14 03:13:42 1987 Date-Received: Wed, 15-Apr-87 05:18:36 EST Sender: usenet@jade.BERKELEY.EDU Reply-To: marcp@beryl.berkeley.edu (Marc M. Pack) Organization: University of California, Berkeley Lines: 24 Hello! I've a couple of questions in UNIX 4.2. 1. How do programs like "more" distinguish between text files and executable files? Hopefully, there's something surer than just taking a sample of a file and testing it. (This question came up when a bunch of people started accidentally sending executables to a line printer, and I was trying to figure out a way to filter out the execs from the texts). 2. Is it possible to, while in a C program, call another program and put it into the background? Actually, I know it's possible, 'cause I can do it with a line like: system("cat textfile &"); This won't work, however, if I try to "more" the file instead. What determines what can be put in the background and what can't? Is there some way to run a program from within a program, and have it return upon completion to the original program besides "system"? (The execl series, of course, doesn't return.) Thanks for your time, Marc M. Pack