[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Synchronous file IO in Lua? Shell escaping?
- From: Tomas Mudrunka <mudrunka@...>
- Date: Tue, 20 Sep 2022 09:47:21 +0200
Turns out that this is roughly equivalent to calling fsync() on fd:
So i went with that. But the argument is not properly escaped, which is
fine in my case, since filename is hardcoded.
On the other hand it would be better if there was some way to pass
individual arguments in array without using shell to parse the
Eg.: something like this:
lua can detect that table was passed rather than string. and bypass the
shell in that case.
That would prevent need to have shell-specific (platform-specific)
escaping in lua...
Dne 2022-09-20 08:40, bil til napsal:
The nasty thing here seems to be, that this is different for any
Usually it would be nice to implement such functionality into flush I
think, but if you have to write different code for any operating
system, then this gets a bit much for Lua?
(fsync e. g. will not be available in MS-Win, in fact I am not sure at
all how you can accomplish this in MS Win software).
(but you could also say, that it would be job of your Linux compiler
to organize such things, so that flush really works "sure" and not
possibly only "virtual").
Am Mo., 19. Sept. 2022 um 18:40 Uhr schrieb Tomas Mudrunka
Note that fflush() flushes only the user-space buffers provided
by the C library. To ensure that the data is physically
on disk the kernel buffers must be flushed too, for example,
sync(2) or fsync(2).
Tomáš Mudruňka - SPOJE.NET s.r.o.