misc_file.h 804 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * misc_file.h
  3. * prototypes for misc_file.c
  4. *
  5. */
  6. #ifndef _EGG_MISC_FILE_H
  7. #define _EGG_MISC_FILE_H
  8. #include <stdio.h>
  9. int copyfile(const char *, const char *);
  10. int movefile(const char *, const char *);
  11. int is_file(const char *);
  12. int can_stat(const char *);
  13. int can_lstat(const char *);
  14. int is_symlink(const char *);
  15. int is_dir(const char *);
  16. int fixmod(const char *);
  17. void check_tempdir(bool);
  18. class Tempfile
  19. {
  20. public:
  21. Tempfile(); //constructor
  22. Tempfile(const char *prefix); //constructor with file prefix
  23. void Tempfile::my_close();
  24. ~Tempfile(); //destructor
  25. bool error; //exceptions are lame.
  26. FILE *f;
  27. char *file;
  28. int fd;
  29. size_t len;
  30. private:
  31. void MakeTemp(); //Used for mktemp() and checking
  32. };
  33. #endif /* _EGG_MISC_FILE_H */