int check_path(char *pathname) //检查目录是否存在而且有RWX的权限
功能说明:
检查目录是否存在,本程序是否具有对目录的RWX权限
函数参数是一个全路径文件名
int movefile(const char *target_path_name, const char *source_path_file_name) //把源文件MV到目标目录
功能说明:
把源文件现link()到目标目录,成功后再删除源文件
源文件名是全路由文件名
int touch(const char *path_file_name)
功能说明:
类似系统命令touch,是更新文件的修改时间;如果文件不存在,失败。
文件名是全路由文件名
is_null_file(const char *path_file_name)
功能说明:
判断文件是否为空文件
1.#include <unistd.h>
int access(const char *pathname, int mode);
2.
#include <stdio.h>
int rename(const char *oldpath, const char *newpath);
3.
看touch源代码
4.
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
int stat(const char *file_name, struct stat *buf);