34 lines
686 B
C
34 lines
686 B
C
#ifndef IO_OPT_H_
|
|
#define IO_OPT_H_
|
|
|
|
#ifndef MAX_PATH_SIZE
|
|
#define MAX_PATH_SIZE 1024
|
|
#endif
|
|
|
|
/*
|
|
* create the dir by full dir_path
|
|
* parameters:
|
|
* path : the dir full path
|
|
* mode : the mode for mkdir
|
|
* return:
|
|
* 0:create dir is success
|
|
* -1 : get current path is error;
|
|
* -2 : change dir is error;
|
|
* -3 : malloc memory to subfolder is error
|
|
* -4 : create dir is error;
|
|
*/
|
|
int mkdir_by_cascading(const char *path, mode_t mode);
|
|
|
|
/*
|
|
* check the first parameter is the dir
|
|
* parameters:
|
|
* path : the dir full path
|
|
* return:
|
|
* 0:the path is dir
|
|
* not 0: the path is not dir
|
|
*/
|
|
int is_dir(const char *path);
|
|
|
|
|
|
#endif /* IO_OPT_H_ */
|