lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading a directory


From: David Nalesnik
Subject: Re: Reading a directory
Date: Fri, 27 Mar 2015 12:32:27 -0500



On Fri, Mar 27, 2015 at 12:19 PM, Mattes <address@hidden> wrote:

Am Freitag, 27. März 2015 18:14 CET, Urs Liska <address@hidden> schrieb:

> Hi,
>
> I think this should be easy, but I don't find it in the Guile reference.
>
> I want a list of filenames in a given directory, what
> os.listdir(dirname) would give me in Python.
>
> What should I use?

Hi Urs,

you need the opendir-readdir-closedir combo:

 (let ((dir (opendir "/etc/")))
   (readdir dir)
   .....
  (closedir dir))

HTH RalfD


This is pretty well hidden in the 1.8 manual.  I found opendir in the procedure index under its C name: scm_opendir.  Here's the page with related stuff:
http://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/File-System.html#index-scm_005freaddir-3063

DN 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]