home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
minnie.tuhs.org
/
unixen.tar
/
unixen
/
PDP-11
/
Trees
/
V7
/
usr
/
src
/
cmd
/
standalone
/
dd.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1998-03-24
|
347 b
|
24 lines
main()
{
int i, j, in;
char buf[512];
do {
printf("Input device: ");
gets(buf);
in = open(buf, 0);
} while (in <= 0);
do {
printf("Output device: ");
gets(buf);
j = open(buf, 1, 0777);
} while (j <= 0);
while (1) {
if ((i = read(in, buf, 512)) <= 0) {
exit(1);
}
write(j, buf, 512);
}
}