[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Synchronous file IO in Lua?
- From: Lourival Vieira Neto <lourival.neto@...>
- Date: Mon, 19 Sep 2022 16:51:11 -0300
On Mon, Sep 19, 2022 at 12:50 PM Tomas Mudrunka <mudrunka@spoje.net> wrote:
>
> Hello,
> i have Lua script on Linux that opens file handle using io.open(),
> writes to it using :write() and closes it using :close().
>
> I really need way to call fsync() on that file descriptor.
> https://man7.org/linux/man-pages/man2/fsync.2.html
>
> Either as an argument, eg.: file:write(true) file:close(true)
> or as separate call file:sync(). Is there way to do that?
You might use an external library like luaposix [1].
[1] https://github.com/luaposix/luaposix
Regards,
--
Lourival Vieira Neto