Xref: utzoo comp.lang.c:28445 comp.sys.ibm.pc.programmer:1318 Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!utgpu!attcan!telly!druid!darcy From: darcy@druid.uucp (D'Arcy J.M. Cain) Newsgroups: comp.lang.c,comp.sys.ibm.pc.programmer Subject: Re: questions about a backup program for the MS-DOS environment Keywords: copy Message-ID: <1990May3.143010.29089@druid.uucp> Date: 3 May 90 14:30:10 GMT References: <1990Apr25.125806.20450@druid.uucp> <12459@wpi.wpi.edu> Reply-To: darcy@druid.UUCP (D'Arcy J.M. Cain) Organization: D'Arcy Cain Consulting, West Hill, Ontario Lines: 23 In article <12459@wpi.wpi.edu> jhallen@wpi.wpi.edu (Joseph H Allen) writes: >In article <1990Apr25.125806.20450@druid.uucp> darcy@druid.UUCP (D'Arcy J.M. Cain) writes: >> while ((n = fread(buf, sizeof(char), BUFSIZ, infile)) != 0) >> fwrite(buf, sizeof(char), n, outfile); > >No, no, no Yuck! Don't use the C functions, and don't use such tiny buffers. >(no wonder it's so slow :-) > >Try (in small or tiny model): > >#include > [ ... A bunch of assembler code shoe-horned into a C program] Double yuck. Not only does this depend on a specific hardware platform, a specific OS, a specific vendor's compiler but even 2 specific models of the compiler out of 6 possible. I bet someone would be hard pressed to modify this code to make it less portable than it is. -- D'Arcy J.M. Cain (darcy@druid) | Government: D'Arcy Cain Consulting | Organized crime with an attitude West Hill, Ontario, Canada | (416) 281-6094 |