C++ FileIO Copy -VS- System("cp file1.x file2.x)

前端 未结 5 1897
自闭症患者
自闭症患者 2021-01-31 22:15

Would it be quicker/efficient to write a file copy routine or should I just execute a System call to cp?

(The file system could differ [nfs, local, reiser, etc], however

5条回答
  •  一向
    一向 (楼主)
    2021-01-31 23:09

    It would not be time efficient to write a file copy routine.

    It is resource intensive to call system to shell a cp.

    You'll be far better served by figuring out the system (function) call that you can make to copy the file. E.g. on Windows it's just CopyFile(src, dst) if I recall correctly.

提交回复
热议问题