tad@killer.UUCP (Tad Marko) (06/27/86)
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. Tad Marko ...!ihnp4!killer!tad
avolio@decuac.DEC.COM (Frederick M. Avolio) (07/01/86)
> 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 -- Fred @ DEC Ultrix Applications Center INET: avolio@decuac.DEC.COM * Fight the Fight * UUCP: {decvax,seismo,cbosgd}!decuac!avolio * Rescue the Unborn *
sandersr@ecn-pc.UUCP (Robert C Sanders) (07/02/86)
In article <978@decuac.DEC.COM> avolio@decuac.DEC.COM (Frederick M. Avolio) writes: >> 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. > >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 > Or even easier yet, under PC/MS DOS, a simple shell script of the form: copy %1 %2 %3 %4 %5 in a file entitled "cp.bat". Unfortuately, you don't get all the options of the UNIX version, but remember, you are talking about PC DOS. Forward all replies to the net.micro.pc newgroup. - bob -- ------------ Continuing Engineering Education Telecommunications Purdue University "Time is a mouse that requires constant feeding..." -- me ...!ihnp4!pur-ee!pc-ecn!sandersr
bzs@bu-cs.UUCP (Barry Shein) (07/05/86)
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
dpw@rayssd.UUCP (Darryl P. Wagoner) (07/05/86)
> 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} -------------------------/