/*
Function:copy file from file1 to file2
How to execute: ./copyfile file1 file2 (under Linux)
Data:2007-05-09
*/
#include /*fprintf(),stderr,BUFSIZ*/
#include /**/
#include /*stderror()*/
#include /*open(),flag*/
#include /*errno*/
#include /*ssize_t*/
#include
#include /*mode_t*/
#define BUFFER_SIZE 3
int main(int argc,char **argv)
{
int from_fd,to_fd;
int bytes_read,bytes_write;
char buffer[BUFFER_SIZE];
char *ptr;
if(argc!=3)
{
fprintf(stderr,"Usage:%s fromfile tofile\n\a",argv[0]);
exit(1);
}
在Linux下用C语言实现文件拷贝
内容版权声明:除非注明,否则皆为本站原创文章。