[prev in list] [next in list] [prev in thread] [next in thread]
List: lilypond-user
Subject: Re: LSR - file information [0.24759]
From: Thomas Morley <thomasmorley65 () gmail ! com>
Date: 2016-11-28 8:49:28
Message-ID: CABsfGyWheERzkq+bhqGs2LvU4hGXUfEos6QgV2Lp6QD0PvXn9g () mail ! gmail ! com
[Download RAW message or body]
2016-11-28 2:26 GMT+01:00 Andrew Bernard <andrew.bernard@gmail.com>:
> 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
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic