lilypond-user
[Top][All Lists]
Advanced

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

Re: LSR - file information [0.24759]


From: Thomas Morley
Subject: Re: LSR - file information [0.24759]
Date: Mon, 28 Nov 2016 09:49:28 +0100

2016-11-28 2:26 GMT+01:00 Andrew Bernard <address@hidden>:
> Hi Harm,
>
>
> In your code, isn't it just slightly odd breaking scheme for a function
> across several calls to #define in lilypond? While that seems to be possible
> (although strangely I can't get your code to compile, with unhelpful error
> messages, but never mind that), would one not write a single function for
> this test?

I took the code from the guile2-manual and slightly extended it.
Search there for
Scheme Procedure: closedir stream
to get the original code.

Intended was a test for two things
(1)
Does guile find the entries in the folder correctly?
(2)
If the entry is a file, run guile against it. Does this work?

> Doing that works fine with 2.19.51 and its guile 1.8. This
> handles the Chinese filename just fine.

For (1)
Indeed, guile-1.8 and guile 2.0.13, both find the file(s) correctly
and displays their names correctly even with chinese characters in the
file

> Also not clear why you write format
> and then also (system format...).

That's for (2)
Example:
#(system "guile whatever-file.scm") stored in a ly-file
will try to run guile against whatever-file.scm
called from within a .ly-file

Within the loop 'entry' will have changing values, thus the need to write
(system (format #f "guile ~a" entry)).
Directly writing (system "guile entry") would mean to run guile
against a (not existing) file called 'entry'.

Anyway, the result for (2) is:
works with guile-1.8 but not with 2.0.13

2.0.13 finds the file (via readdir) and displays the name correctly,
but is not able to compile while called from system.

A direct test for (2) would be to do in ly-file
#(system "guile path/to/filename_名字.scm")

or in terminal:

guile path/to/filename_名字.scm

I tried all this before, watching guile-2.0.13 failing...

>
> Andrew
>
> == snip
>
> \version "2.19.51"
>
> dirfunc =
> #(define-void-function (directory)
>    (string?)
>    (let* ((d (opendir directory)))
>      (let loop ((dir-entry (readdir d)))
>        (if (not (eof-object? dir-entry))
>            (begin
>             (format #t "~a: type: ~a\n" dir-entry (stat:type (stat
> dir-entry)))
>             (loop (readdir d))
>             )))
>      (closedir d)))
>
> \dirfunc "."
>
> == snip

Thanks for your code,
  Harm



reply via email to

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