Files
2025-06-28 16:10:13 +08:00

28 lines
557 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef FILE_UTILS_H
#define FILE_UTILS_H
#include <stdbool.h>
/**
* 检查文件是否存在
* @param path 文件路径
* @return true表示存在false表示不存在
*/
bool file_exists(const char* path);
/**
* 获取文件大小
* @param path 文件路径
* @return 文件大小(字节)-1表示错误
*/
long file_size(const char* path);
/**
* 获取文件扩展名
* @param path 文件路径
* @return 扩展名字符串(包含.)NULL表示没有扩展名
*/
const char* file_extension(const char* path);
#endif // FILE_UTILS_H