misc_file.h 704 B

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