复制1万个pdf

 

#include<stdio.h> 
  #include<unistd.h> 
  #include<string.h>   
  int main() 
  { 
    FILE *fp=NULL; 
   int i = 0;
for(i=0; i<10000;i++)
{   
 char buff[128]={0};   
   memset(buff,0,sizeof(buff)); 
   sprintf(buff,"cp 1.pdf %d.pdf",i);
   fp=popen(buff,"r");//将命令ls-l 同过管道读到fp 
   pclose(fp); 
}
   return 0;   
   }

 

posted on 2020-07-15 17:07  lydstory  阅读(141)  评论(0)    收藏  举报

导航