[cs631apue] TestCP Script Issue

Jan Schaumann jschauma at stevens.edu
Thu Sep 16 13:34:50 EDT 2021


Shivam Sheth <ssheth7 at stevens.edu> wrote:
> The test script I'm
> using<https://stevens.netmeister.org/631/testcp.sh>
> does not have a "-x" option, only the -h, -p, and -v
> options.

Run it like this;

$ sh -x testcp.sh <your other args here>

> Also, regarding the machine our code will be tested
> on, how much memory will it have? My copy program
> was able to copy the big file with 4096MB of memory,
> but not with 1024MB.

Sounds like you're reading the entire file into memory
at once.  That's not a scalable approach.  You need to
read/write in chunks.

Your program should work just fine without any
consideration of RAM, just like the system's cp(1)
command does not bail out if you have less than 4GB
RAM.

-Jan


More information about the cs631apue mailing list