[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: C and system calls

"Bart Friederichs" <plant@chello.nl> writes:

> Are there any system calls to move or copy files? I know I can do it with
> system("") but i don't like that solution.

For move, user rename(2). For copying, you need to do it by hand
(e.g. open the from file for reading, the to file for writing, then
read(2) the from file and write(2) the to file until you reach EOF).

Jakob 'sparky' Kaivo - jkaivo@ndn.net - http://jakob.kaivo.net/

Reply to: