zizi21
asked on
urgent: how to concat files in C
hi,
assuming i have file a, b, c and d. is there a faster way to combine these files instead of using, fread file b and write to file a. then, read file c , and write to file a and so on.
in the unix system, we use cat a b c d > newfile. is there a cat function is c ? thanks
assuming i have file a, b, c and d. is there a faster way to combine these files instead of using, fread file b and write to file a. then, read file c , and write to file a and so on.
in the unix system, we use cat a b c d > newfile. is there a cat function is c ? thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
"No,
cat uses almost same algo as You mentioned - opens every file, read and writes to stdout."
But does this mean that the cat would use the RAM memory ?
cat uses almost same algo as You mentioned - opens every file, read and writes to stdout."
But does this mean that the cat would use the RAM memory ?
ASKER
I don't understand. When fread and fwrite is used, you need a buffer. Does this mean that cat doesn't use buffer memory ?
ASKER
i have posted the question regarding cat below:
https://www.experts-exchange.com/questions/27024223/please-help-using-system-call-cat-with-fread-and-fwrite.html
https://www.experts-exchange.com/questions/27024223/please-help-using-system-call-cat-with-fread-and-fwrite.html
ASKER
Pls take a look
cat uses almost same algo as You mentioned - opens every file, read and writes to stdout.