lua-users home
lua-l archive

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


I'm getting the 'Interrupted system call' on OSX 10.8.5 while trying to read from io.popen within an application that embeds Lua. The same code works fine in the Lua interpreter:

function listfonts()
      local f = io.popen([[python -c "import Cocoa
manager = Cocoa.NSFontManager.sharedFontManager()
font_families = list(manager.availableFontFamilies())

for font in font_families:
    print font"]])

      if not f then return nil, "Python code to retrieve installed fonts didn't work" end

      local fonts = {}
      for font in f:lines() do
        fonts[#fonts+1] = font
      end

      f:close()

      return fonts
end

Lua was installed from Homebrew and linked via pkg-config which gives -L/usr/local/lib -llua -lm as the flags it used I tried compiling the application both via clang and gcc, same problem on both.

This is something that comes up often, but there does not seem to be one agreedupon solution and I haven't been able to work this out.

Any ideas?