Does anyone have the source for a PD cp?
Barry Shein
bzs at bu-cs.UUCP
Sat Jul 5 13:04:07 AEST 1986
From: avolio at 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
More information about the Comp.unix
mailing list