复制一个文件并且重新命名
来源:互联网 发布:python supervisor 编辑:程序博客网 时间:2024/05/16 15:10
#include <stdio.h>
int copy_file(char *a,char *b);
int main()
{
char a[50],b[50];
printf("please input the old file namne:/n");
gets(a);
printf("please input the new file namne:/n");
gets(b);
copy_file(a,b);
return 0;
}
int copy_file(char *a,char *b)
{
FILE *fp_in,*fp_out;
int fsize;
char buffer[256];
fp_in=fopen(a,"r");
fseek(fp_in,0,SEEK_END);
fsize=ftell(fp_in);
printf("file size is %d/n",fsize);
fseek(fp_in,0,SEEK_SET);
fp_out=fopen(b,"w");
fread(buffer,fsize,1,fp_in);
fwrite(buffer,fsize,1,fp_out);
fclose(fp_in);
fclose(fp_out);
printf("/ncopy and rename file complete/n");
return 0;
}
运行:
please input the old file namne:
in.txt
please input the new file namne:
out.txt
fsize is 9
copy and rename file complete
- 复制一个文件并且重新命名
- 奇偶文件重新命名
- 免费的工具-CloneFolder(复制和重新命名Inventor文件)
- java项目复制后重新命名方法
- 生了DDE错误,并且说明由于文件名或路径太长,请尝试重新命名该文件或将其复制到其
- python 复制并重命名文件
- 批处理复制文件并重命名
- php 复制文件并重命名
- 上传文件重新命名(test-001-A)
- Unity3d_iGUI_对iGUICode_xx.cs文件重新命名
- altium designer 重新给文件命名
- 远程登录windows 并且复制文件
- python批量复制并且重命名文件
- 文件上传---文件解压---读取文件---文件重新命名压缩
- 复制一个文件夹包括里面的文件,并以指定名字命名
- 用脚本提取一个文件夹内的某些文件,并且将文件复制到制定目录下
- 重新压缩一个AVI文件
- 重新压缩一个AVI文件
- “凡使用他人原话在3个连续词以上,都要使用直接引号,否则即使注明出处,仍视为抄袭”
- 用flex/flash开发opensocail应用
- Wince和Windows Mobile的关系
- 技术化要向管理化进军
- 读取php.ini文件
- 复制一个文件并且重新命名
- oracle之_gby_hash_aggregation_enabled
- 本文无意义,用于储存csdn论坛问题发贴所需图片
- 用VB.NET打造个性化ListBox控件(图)
- 灰色的生活
- IBM一面
- CRM促进中小企业发展 五大策略应对实施问题
- 对象的内存模型
- 云计算如何为中小企业服务