最近学校的项目实训要求在Linux下开发一个多人聊天系统,其中一个小功能是实现图片发送与接收,前提自然是能实现图片的拷贝了。贴出代码和一些项目资料记录一下自己的学习历程。
图片拷贝代码:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main(void)
{
int fd = open("12.jpg", O_RDONLY);
int fd1 = open("work.jpg", O_CREAT