遇见YY

导航

 
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
int main() {
    
    int fdr = open("dm.mp4", O_RDONLY);
    int fdw = open("cp.mp4", O_RDWR | O_CREAT,0777);
    const int MaxSize = 1024;
    uint8_t buf[MaxSize];
    int ret = -1;
    while ((ret = read(fdr, buf, MaxSize))) {
        write(fdw, buf, ret);
    }
    close(fdr);
    close(fdw);    
    
    return 0;
}
posted on 2020-10-07 19:30  一骑红尘妃子笑!  阅读(201)  评论(0编辑  收藏  举报