lua-users home
lua-l archive

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


> How to trim existing file from 2Gb to 1Gb using lua io?

Lua I/O doesn't provide any function to truncate a file. I supported
suggestion to add one. See this thread for a previous discussion on
this topic: http://lua.2524044.n2.nabble.com/Function-to-truncate-a-file-td7684482.html

If you need a portable solution, you can use Lua/APR
(http://peterodding.com/code/lua/apr/docs/#file:truncate) or fs
library (https://luapower.com/fs; requires FFI).

Paul.

On Thu, Jun 20, 2019 at 4:21 PM Sergey Kovalev <kovserg33@gmail.com> wrote:
>
> How to trim existing file from 2Gb to 1Gb using lua io?
>