• C

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
zizi21Asked:
Who is Participating?
 
n2fcConnect With a Mentor Commented:
You can always use the "system" call to access the shell commands!

This way you can use ANY shell command (like cat) from within c...
0
 
ravenplCommented:
No,
cat uses almost same algo as You mentioned - opens every file, read and writes to stdout.
0
 
zizi21Author Commented:
"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 ?
0
Worried about phishing attacks?

90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

 
zizi21Author Commented:
I don't understand. When fread and fwrite is used, you need a buffer. Does this mean that cat doesn't use buffer memory ?
0
 
zizi21Author Commented:
i have posted the question regarding cat below:
http://www.experts-exchange.com/Programming/Languages/C/Q_27024223.html
0
 
zizi21Author Commented:
Pls take a look
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.