/**
* Move or rename a resource.
*
* @note url_src and url_dst should share the same protocol and authority.
*
* @param url_src url to resource to be moved
* @param url_dst new url to resource if the operation succeeded
* @return >=0 on success or negative on error.
*/
int avpriv_io_move(const char *url_src, const char *url_dst);
/**
* Delete a resource.
*
* @param url resource to be deleted.
* @return >=0 on success or negative on error.
*/
int avpriv_io_delete(const char *url);
ffmpegfile.c
#include <libavformat/avformat.h>
#include <libavutil/avutil.h>
int main(int argc,char *argv[]){
int ret;
ret = avpriv_io_move("./2.txt","./1.txt");
if (ret<0){
av_log(NULL,AV_LOG_ERROR,"fail to move");
}
av_log(NULL,AV_LOG_INFO,"success to move");
//url
ret = avpriv_io_delete("./1.txt");
if (ret<0){
av_log(NULL,AV_LOG_ERROR,"fail to delete\n");
return -1;
}
av_log(NULL,AV_LOG_INFO,"Success to delete\n");
return 0;
}