Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!princeton!allegra!rayssd!dpw From: dpw@rayssd.UUCP (Darryl P. Wagoner) Newsgroups: net.wanted.sources,net.unix Subject: Re: Re: Does anyone have the source for a PD cp? Message-ID: <2349@rayssd.UUCP> Date: Sat, 5-Jul-86 00:27:54 EDT Article-I.D.: rayssd.2349 Posted: Sat Jul 5 00:27:54 1986 Date-Received: Sat, 5-Jul-86 08:58:19 EDT References: <220@killer.UUCP> <978@decuac.DEC.COM> Sender: dpw@rayssd.UUCP (Darryl P. Wagoner @ Raytheon Co., Portsmouth RI) Organization: Raytheon Co., Portsmouth RI Lines: 32 Xref: watmath net.wanted.sources:2502 net.unix:8522 > Summary: You kidding? > > > Does anyone have the source code for a Public Domain cp? I'm wanting to > > write one for my IBM AT to compile and use under DOS, but I don't have the > > slightest idea how to do it right. Thanks in advance. > > Egad! You don't have a degree in computer science, do you? > > Ok... > > open first file (checking for errors ... bailout if necessary) > creat second file (checking for errors ... bailout if necessary) > while (read a buffer from first file) is greater than 0, > write a buffer to second file (check for errors..) > exit That will not work if you have something like "cp file1 [file2 ...] target". Althought I have to admit that even that is not too complex. Since that cp comes with unix I gather that the requester wants something more that just cp. As in 4.2 BSD cp that has the -r option. Don't mind me it late and I am tried. -- Darryl Wagoner Raytheon Co.; Portsmouth RI; (401)-847-8000 x4089 best path {allegra|gatech|mirror|raybed2} ---------\ next best {linus|ihnp4|pyrbos} ---------------------->!rayssd!dpw if all else fails {brunix|cci632} -------------------------/