misc_file.h 726 B

12345678910111213141516171819202122232425262728293031323334353637
  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();
  18. class Tempfile
  19. {
  20. public:
  21. Tempfile(); //constructor
  22. Tempfile(const char *prefix); //constructor with file prefix
  23. ~Tempfile(); //destructor
  24. FILE *f;
  25. char *file;
  26. int fd;
  27. size_t len;
  28. private:
  29. void MakeTemp(); //Used for mktemp() and checking
  30. };
  31. #endif /* _EGG_MISC_FILE_H */