Next: , Up: Using the Guile Module System   [Contents][Index]

2.5.1 Using Modules

Guile comes with a lot of useful modules, for example for string processing or command line parsing. Additionally, there exist many Guile modules written by other Guile hackers, but which have to be installed manually.

Here is a sample interactive session that shows how to use the (ice-9 popen) module which provides the means for communicating with other processes over pipes together with the (ice-9 rdelim) module that provides the function read-line.

$ guile
[email protected](guile-user)> (use-modules (ice-9 popen))
[email protected](guile-user)> (use-modules (ice-9 rdelim))
[email protected](guile-user)> (define p (open-input-pipe "ls -l"))
[email protected](guile-user)> (read-line p)
$1 = "total 30"
[email protected](guile-user)> (read-line p)
$2 = "drwxr-sr-x    2 mgrabmue mgrabmue     1024 Mar 29 19:57 CVS"