#include<stdio.h>
#include<stdlib.h>

int main()
{
   int ret = rename("./file_mmap","/root/file_mmap");  
   if(ret<0)
   {
     perror("rename error\n");
   }
   /***
   (1) 本路径重命名 
   (2) 移动文件    注意要使用绝对路径 不能使用相对路径
   **/
   remove("aabc.c");  // 删除文件     都是c库
   printf("ret is %d\n",ret);
   while(1);

 return 0;
}

 

相关文章:

  • 2022-01-16
  • 2022-01-22
  • 2021-09-29
  • 2022-12-23
  • 2021-06-27
  • 2021-12-03
  • 2022-12-23
  • 2021-10-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2021-10-16
  • 2022-12-23
  • 2021-08-19
  • 2022-02-17
相关资源
相似解决方案