Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!topaz!uwvax!harvard!bu-cs!bzs From: bzs@bu-cs.UUCP (Barry Shein) Newsgroups: net.wanted.sources,net.unix Subject: Re: Does anyone have the source for a PD cp? Message-ID: <896@bu-cs.UUCP> Date: Fri, 4-Jul-86 23:04:07 EDT Article-I.D.: bu-cs.896 Posted: Fri Jul 4 23:04:07 1986 Date-Received: Sat, 5-Jul-86 08:56:47 EDT Organization: Boston Univ Comp. Sci. Lines: 31 Xref: watmath net.wanted.sources:2501 net.unix:8520 From: avolio@decuac.DEC.COM (Frederick M. Avolio) >> 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 Gimme a break Fred, this is net.unix, people can ask questions like this. Besides, how does your pseudocode handle the -r option? And permissions? And multiple file names to a directory? And the -i option? And checking for copying a file to itself (hint: it works with links)? Cp isn't very hairy, but it's a lot hairier than that. Egad! You don't work for DEC, do you? That's right, I guess the rest will be in the "next release"... [C'mon, you asked for it] -Barry Shein, Boston University