diff options
author | Gary Houston <ghouston@arglist.com> | 1999-09-11 14:12:14 +0000 |
---|---|---|
committer | Gary Houston <ghouston@arglist.com> | 1999-09-11 14:12:14 +0000 |
commit | 77242ff9cd89096044093ba6012ec4bd34668e28 (patch) | |
tree | 43e501017322f0fc62db1695167e806805fe1220 | |
parent | 08cc62c7d91de170838536d938a00ce980182d79 (diff) | |
download | guile-77242ff9cd89096044093ba6012ec4bd34668e28.tar.gz |
1999-09-11 Gary Houston <ghouston@easynet.co.uk>
* filesys.c (scm_directory_p): new procedure "directory?" Returns
a boolean indicating whether its argument is a directory
port as returned by opendir (thanks to Dirk Herrmann for the
suggestion.)
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | libguile/ChangeLog | 7 | ||||
-rw-r--r-- | libguile/filesys.c | 7 | ||||
-rw-r--r-- | libguile/filesys.h | 1 |
5 files changed, 21 insertions, 0 deletions
@@ -46,6 +46,11 @@ Return a new port with the associated print state PRINT-STATE. Return the print state associated with this port if it exists, otherwise return #f. +*** New function: directory? OBJECT + +Returns a boolean indicating whether OBJECT is a directory port as +returned by `opendir'. + * Changes to the scm_ interface ** The internal representation of subr's has changed @@ -10,6 +10,7 @@ Bug reports and fixes from: Greg Badros Rodney Brown Ian Grant + Dirk Herrmann Anders Holst Karoly Lorentey Han-Wen Nienhuys diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 2272692ee..bc20032c9 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +1999-09-11 Gary Houston <ghouston@easynet.co.uk> + + * filesys.c (scm_directory_p): new procedure "directory?" Returns + a boolean indicating whether its argument is a directory + port as returned by opendir (thanks to Dirk Herrmann for the + suggestion.) + 1999-09-11 Mikael Djurfeldt <mdj@thalamus.nada.kth.se> * backtrace.c (display_frame_expr): Don't print a newline. diff --git a/libguile/filesys.c b/libguile/filesys.c index 96c4e9b30..83211dd70 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -581,6 +581,13 @@ scm_rmdir (path) long scm_tc16_dir; +SCM_PROC (s_directory_p, "directory?", 1, 0, 0, scm_directory_p); +SCM +scm_directory_p (SCM obj) +{ + return SCM_NIMP (obj) && SCM_DIRP (obj) ? SCM_BOOL_T : SCM_BOOL_F; +} + SCM_PROC (s_opendir, "opendir", 1, 0, 0, scm_opendir); SCM diff --git a/libguile/filesys.h b/libguile/filesys.h index 17cee89c4..9aa019ac1 100644 --- a/libguile/filesys.h +++ b/libguile/filesys.h @@ -66,6 +66,7 @@ extern SCM scm_rename SCM_P ((SCM oldname, SCM newname)); extern SCM scm_delete_file SCM_P ((SCM str)); extern SCM scm_mkdir SCM_P ((SCM path, SCM mode)); extern SCM scm_rmdir SCM_P ((SCM path)); +extern SCM scm_directory_p (SCM obj); extern SCM scm_opendir SCM_P ((SCM dirname)); extern SCM scm_readdir SCM_P ((SCM port)); extern SCM scm_rewinddir SCM_P ((SCM port)); |