is_writable.h 567 B

123456789101112131415161718192021
  1. #ifndef IGL_IS_WRITABLE_H
  2. #define IGL_IS_WRITABLE_H
  3. #include "igl_inline.h"
  4. namespace igl
  5. {
  6. // Check if a file exists *and* is writable like PHP's is_writable function:
  7. // http://www.php.net/manual/en/function.is-writable.php
  8. // Input:
  9. // filename path to file
  10. // Returns true if file exists and is writable and false if file doesn't
  11. // exist or *is not writable*
  12. //
  13. // Note: Windows version will not test group and user id
  14. IGL_INLINE bool is_writable(const char * filename);
  15. }
  16. #ifdef IGL_HEADER_ONLY
  17. # include "is_writable.cpp"
  18. #endif
  19. #endif