11 #include <sys/types.h>
19 std::cout <<
"** usage: prdflist infile outfile1 outfile2 ..." << std::endl;
50 int main(
int argc,
char *argv[])
53 unsigned int buffer[8*8192];
58 int nr_outfiles = argc-2;
59 int *fdout =
new int[nr_outfiles];
62 fd =
open(argv[1], O_RDONLY | O_LARGEFILE);
64 for ( i=0; i< nr_outfiles; i++)
68 fdout[
i] =
open(argv[2+i], O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE ,
69 S_IRWXU | S_IROTH | S_IRGRP);
72 std::cout <<
" could not open " << argv[2+
i] << std::endl;
88 xc =
read ( fd, (
char *)buffer, 8192);
101 if ( markerstatus == -1)
111 int nwritten =
write (fdout[current_fdnr], buffer, 8192);
112 if ( nwritten < 8192)
114 std::cout <<
" could not write output " << total_read << std::endl;
120 xc =
read ( fd, (
char *)buffer, 8192);
123 std::cout <<
"end or error in read loop at rec " << total_read << std::endl;
128 nwritten =
write (fdout[current_fdnr], buffer, 8192);
133 if ( ++current_fdnr >= nr_outfiles) current_fdnr = 0;
136 xc =
read ( fd, (
char *)buffer, 8192);
139 for ( i=0; i< nr_outfiles; i++)