lua-users home
lua-l archive

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


gary ng wrote:
How would coroutine help in this file copy case,
assuming we are using the stock lua file io library
which is not async capable ?

You could read large file in smaller blocks while at the same time do something else (if you need to). So use file:read(buffersize) with buffersize that matches your hardware best.

Regards,
miko