Hi Claude adn list,

Back again with my spelling function written in lua. I've got a problem 
in the terminal sometimes (pretty often in fact) :

error: lua: error in dispatcher:
[string "lspell"]:13: echo fhdkq | /sw/bin/ispell -a | grep \\*: Too 
many open files

when using my object "lspell.pd_lua", feeding the inlet with [symbol 
fhdkq( for example.
When this error appears the object is not working. This error occurs in 
groups : appearing for 5-20 seconds and disappearing for 10 - 60 seconds.
What exactly is this error?
I guess this is a kind of overflow of the usage lua can make of the 
terminal, but I was wandering if there is some workaround technique to 
avoid this?
Has someone an idea of the time one must wait between two usage of the 
same object?
My current code is:


local LSpell = pd.Class:new():register("lspell")

function LSpell:initialize(name, atoms)
    self.outlets = 1
    self.inlets = 1
    return true
end

function LSpell:in_1_symbol(s)
    local word = s

    local cmd = "echo " .. word .. " | /sw/bin/ispell -a | grep \\*"

    local p = assert(io.popen(cmd))

    local result = p:read("*all")
    if(string.len(result) ~= 0) then
      self:outlet(1, "symbol", {word})
      end

end

Thanks in advance,

Nicolas

-- 
http://nim.on.free.fr

_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to