标准块CP功能实现
#include<stdio.h> int main(int argc,char *argv[])
{
FILE *src_fp,*des_fp;
int src_ret;
char buf[]={}; if(argc != )
{
printf("please input paramester\n");
return -;
} //打开源文件
src_fp = fopen(argv[],"r");
if(src_fp == NULL)
{
printf("open the file %s is failure\n",argv[]);
return -;
}
printf("open the file %s is success\n",argv[]); //打开目的文件
des_fp = fopen(argv[],"w");
if(des_fp == NULL)
{
printf("open the file %s is failure\n",argv[]);
return -;
}
printf("open the File %s is success\n",argv[]); //将源文件拷到目的文件中
while()
{
src_ret = fread(buf,,,src_fp);
if(src_ret == )
{
printf("the file is end\n");
break;
}
fwrite(buf,,src_ret,des_fp);
} //关闭文件流
fclose(src_fp);
fclose(des_fp);
return ;
}
标准块CP功能实现的更多相关文章
- 编程实现类似Linux系统的cp功能
选做题目以及分析 题目:编写MyCP.java 实现类似Linux下cp XXX1 XXX2的功能,要求MyCP支持两个参数: java MyCP -tx XXX1.txt XXX2.bin 用来把文 ...
- 编程实现类似Linux下cp功能
MyCP的代码实现 一.题目要求: 编写MyCP.java 实现类似Linux下cp XXX1 XXX2的功能,要求MyCP支持两个参数: java MyCP -tx XXX1.txt XXX2.bi ...
- 标准字符cp功能
#include<stdio.h> #include<fcntl.h> int main(int argc,char *argv[]) { FILE *src_fp,*des_ ...
- 文件cp功能
#include<stdio.h> #include<unistd.h> #include<fcntl.h> #include<string.h> in ...
- 标准行cp功能
#include<stdio.h> int main(int argc,char *argv[]) { FILE *src_fp,*des_fp; ]={}; ) { printf(&qu ...
- linux笔记:目录处理命令ls,mkdir,cd,pwd,rmdir,cp,mv,rm
linux命令的格式:命令 [-选项] [参数]例:ls -la /etc 命令:ls命令所在路径:/bin/ls功能:显示目录文件用法:ls [-aldh] []参数:-a 查看所有文件,包括隐藏文 ...
- MyCP -tx -xt 功能的Java实现
MyCP -tx -xt 功能的Java实现 功能简介 java MyCP -tx XXX1.txt XXX2.bin 用来把文本文件(内容为十进制数字)转化为二进制文件 java MyCP -xt ...
- Linux文件系统命令 cp
命令名:cp 功能:拷贝文件,把一个文件的内容拷贝到另外一个文件中去. eg: cp source_file dist_file renjg@renjg-HP-Compaq-Pro--MT:~$ cp ...
- 【Linux】cp命令的各种妙用
CP 功能: 复制文件或目录 说明: cp指令用于复制文件或目录,如同时指定两个以上的文件或目录,且最后的目的地是一个已经存在的目录,则它会把前面指定的所有文件或目录复制到此目录中.若同时指定多个文件 ...
随机推荐
- [Bzoj2286][Sdoi2011]消耗战(虚树模板题附讲解)
2286: [Sdoi2011]消耗战 Time Limit: 20 Sec Memory Limit: 512 MBSubmit: 4896 Solved: 1824[Submit][Statu ...
- java构造方法的特点和理解--三只坚果
构造方法的特点:1.首先构造方法是基于类,名字必须与类的名字完全相同(构造方法一般是自己编写的类需要初始化)2.每个类都有一个默认的构造方法,既无参数又无返回值,其作用是使用new操作符创建新对象后初 ...
- rror Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnec
在mysql5中,可以设置safe mode,比如在一个更新语句中 UPDATE table_name SET bDeleted=0; 执行时会错误,报: You are using safe upd ...
- InfluxDB useful commands
InfluxDB 配置文件地址:/etc/influxdb/influxdb.conf 通过curl写数据 curl -i -XPOST 'http://localhost:8086/write?db ...
- Cg入门6:函数2
内建函数分为四类: 1.数学函数 2.几何函数 3.纹理函数 4.导数函数:事实上就是片段函数
- Codeforces Round #277 (Div. 2)---C. Palindrome Transformation (贪心)
Palindrome Transformation time limit per test 1 second memory limit per test 256 megabytes input sta ...
- Spring4.0MVC学习资料,注解自己主动扫描bean,自己主动注入bean(二)
Spring4.0的新特性我们在上一章已经介绍过了. 包含它对jdk8的支持,Groovy Bean Definition DSL的支持.核心容器功能的改进,Web开发改进.測试框架改进等等.这张我们 ...
- LoadRunner系列之—-03 用Java Vuser协议编写接口测试脚本
待测试接口用java语言实现,且项目中调用该接口需要用专门的jar包.这种情况可以用Java Vuser协议实现接口调用脚本,类似java代码. 代码样例如下: /* * LoadRunner Jav ...
- React通过Ajax获取数据
React 组件的数据可以通过 componentDidMount 方法中的 Ajax 来获取,当从服务端获取数据库可以将数据存储在 state 中,再用 this.setState 方法重新渲染 U ...
- 【iOS系列】-UIWebView加载网页禁止左右滑动
[iOS系列]-UIWebView加载网页禁止左右滑动 问题: 做项目时候,用UIWebView加载网页的时候,要求是和微信网页中打开的网页的效果一样,也即是只能上下滑动,不能左右滑动,也不能缩放. ...