filesys.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef SCM_FILESYS_H
  2. #define SCM_FILESYS_H
  3. /* Copyright 1995,1997-2001,2006,2008-2011,2013,2018,2021
  4. Free Software Foundation, Inc.
  5. This file is part of Guile.
  6. Guile is free software: you can redistribute it and/or modify it
  7. under the terms of the GNU Lesser General Public License as published
  8. by the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Guile is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  13. License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with Guile. If not, see
  16. <https://www.gnu.org/licenses/>. */
  17. #include <libguile/error.h>
  18. SCM_API scm_t_bits scm_tc16_dir;
  19. #define SCM_DIR_FLAG_OPEN (1L << 0)
  20. #define SCM_DIRP(x) (SCM_HAS_TYP16 (x, scm_tc16_dir))
  21. #define SCM_DIR_OPEN_P(x) (SCM_SMOB_FLAGS (x) & SCM_DIR_FLAG_OPEN)
  22. #define SCM_VALIDATE_DIR(pos, port) \
  23. SCM_MAKE_VALIDATE_MSG (pos, port, DIRP, "directory port")
  24. SCM_API SCM scm_chown (SCM object, SCM owner, SCM group);
  25. SCM_API SCM scm_chownat (SCM dir, SCM object, SCM owner, SCM group, SCM flags);
  26. SCM_API SCM scm_chmod (SCM object, SCM mode);
  27. SCM_API SCM scm_chmodat (SCM dir, SCM pathname, SCM mode, SCM flags);
  28. SCM_API SCM scm_umask (SCM mode);
  29. SCM_API SCM scm_open_fdes (SCM path, SCM flags, SCM mode);
  30. SCM_API SCM scm_open_fdes_at (SCM dir, SCM path, SCM flags, SCM mode);
  31. SCM_API SCM scm_open (SCM path, SCM flags, SCM mode);
  32. SCM_API SCM scm_openat (SCM dir, SCM path, SCM flags, SCM mode);
  33. SCM_API SCM scm_close (SCM fd_or_port);
  34. SCM_API SCM scm_close_fdes (SCM fd);
  35. SCM_API SCM scm_stat (SCM object, SCM exception_on_error);
  36. SCM_API SCM scm_statat (SCM dir, SCM filename, SCM flags);
  37. SCM_API SCM scm_link (SCM oldpath, SCM newpath);
  38. SCM_API SCM scm_rename (SCM oldname, SCM newname);
  39. SCM_API SCM scm_renameat (SCM olddir, SCM oldname, SCM newdir, SCM newname);
  40. SCM_API SCM scm_delete_file (SCM str);
  41. SCM_API SCM scm_delete_file_at (SCM dir, SCM str, SCM flags);
  42. SCM_API SCM scm_mkdir (SCM path, SCM mode);
  43. SCM_API SCM scm_mkdirat (SCM dir, SCM path, SCM mode);
  44. SCM_API SCM scm_rmdir (SCM path);
  45. SCM_API SCM scm_directory_stream_p (SCM obj);
  46. SCM_API SCM scm_opendir (SCM dirname);
  47. SCM_API SCM scm_readdir (SCM port);
  48. SCM_API SCM scm_rewinddir (SCM port);
  49. SCM_API SCM scm_closedir (SCM port);
  50. SCM_API SCM scm_chdir (SCM str);
  51. SCM_API SCM scm_getcwd (void);
  52. SCM_API SCM scm_select (SCM reads, SCM writes, SCM excepts, SCM secs, SCM msecs);
  53. SCM_API SCM scm_fcntl (SCM object, SCM cmd, SCM value);
  54. SCM_API SCM scm_fsync (SCM object);
  55. SCM_API SCM scm_symlink (SCM oldpath, SCM newpath);
  56. SCM_API SCM scm_symlinkat (SCM dir, SCM oldpath, SCM newpath);
  57. SCM_API SCM scm_readlink (SCM path);
  58. SCM_API SCM scm_lstat (SCM str);
  59. SCM_API SCM scm_copy_file (SCM oldfile, SCM newfile);
  60. SCM_API SCM scm_mkstemp (SCM tmpl);
  61. SCM_API SCM scm_mkdtemp (SCM tmpl);
  62. SCM_API SCM scm_dirname (SCM filename);
  63. SCM_API SCM scm_basename (SCM filename, SCM suffix);
  64. SCM_API SCM scm_canonicalize_path (SCM path);
  65. SCM_API SCM scm_sendfile (SCM out, SCM in, SCM count, SCM offset);
  66. SCM_INTERNAL SCM scm_i_relativize_path (SCM path, SCM in_path);
  67. SCM_INTERNAL void scm_init_filesys (void);
  68. #endif /* SCM_FILESYS_H */