2016计算机基地-倪纯淳-实验十一.docxVIP

  • 4
  • 0
  • 约4.36千字
  • 约 7页
  • 2018-07-03 发布于上海
  • 举报
实验十一实验名称:文件系统编程实验目的:学习和掌握使用系统调用操作文件和目录的属性、内容的方法实验要求: 编写一个程序,实现将一个目录的所有内容复制到另一个目录的功能。要求:源文件(目录)和目标文件(目录)的属主、权限等信息保持一致;每复制一个文件(目录),在屏幕提示相应信息;当遇到符号链接文件时,显示该文件为链接文件,不复制。实验源代码为:#include stdio.h#include stdlib.h#include string.h#include sys/types.h#include fcntl.h#include unistd.h#include dirent.h#define SIZE 2048int cp(char* src_file_path,char *des_file_path);//复制功能int cp_file(char* new_srcpath,char* new_despath);//复制文件int cp_dir(char* des_path,char* src_path);int chnge_attr(char* file,struct stat src_buf);char* myStrtok(char *src);//截取文件名int gen_path(char path[],char file[]);//生成路径int main(){ str

文档评论(0)

1亿VIP精品文档

相关文档