plastimatch
Loading...
Searching...
No Matches
file_util.h
Go to the documentation of this file.
1/* -----------------------------------------------------------------------
2 See COPYRIGHT.TXT and LICENSE.TXT for copyright and license information
3 ----------------------------------------------------------------------- */
4#ifndef _file_util_h_
5#define _file_util_h_
6
7#include "plmsys_config.h"
8#include <string>
9#include <stdio.h>
10#include "plm_int.h"
11
12PLMSYS_API int file_exists (const char *filename);
13PLMSYS_API int file_exists (const std::string& filename);
14PLMSYS_API uint64_t file_size (const char *filename);
15PLMSYS_API int is_directory (const char *dir);
16PLMSYS_API int is_directory (const std::string& dir);
17PLMSYS_API void touch_file (const std::string& filename);
18PLMSYS_API void copy_file (const std::string& dst_fn,
19 const std::string& src_fn);
20PLMSYS_API void make_directory (const char *dirname);
21PLMSYS_API void make_directory (const std::string& dirname);
22PLMSYS_API void make_parent_directories (const char *filename);
23PLMSYS_API void make_parent_directories (const std::string& filename);
24PLMSYS_API void make_directory_recursive (const std::string& dirname);
25PLMSYS_API FILE* make_tempfile (void);
26PLMSYS_API char* plm_getcwd (char* s, int len);
27PLMSYS_API int plm_chdir (char* s);
28PLMSYS_API FILE* plm_fopen (const char *path, const char *mode);
29PLMSYS_API FILE* plm_fopen (const std::string& path, const char *mode);
30
31#endif
uint64_t file_size(const char *filename)
Definition file_util.cxx:73
void copy_file(const std::string &dst_fn, const std::string &src_fn)
Definition file_util.cxx:93
void make_directory(const char *dirname)
Definition file_util.cxx:102
int file_exists(const char *filename)
Definition file_util.cxx:56
void touch_file(const std::string &filename)
Definition file_util.cxx:82
int plm_chdir(char *s)
Definition file_util.cxx:210
FILE * make_tempfile(void)
Definition file_util.cxx:179
void make_directory_recursive(const std::string &dirname)
Definition file_util.cxx:157
char * plm_getcwd(char *s, int len)
Definition file_util.cxx:198
FILE * plm_fopen(const char *path, const char *mode)
Definition file_util.cxx:164
int is_directory(const char *dir)
Definition file_util.cxx:25
void make_parent_directories(const char *filename)
Definition file_util.cxx:131
std::string dirname(const std::string &fn)
Definition path_util.cxx:156
#define PLMSYS_API
Definition plmsys_config.h:19