lua-users home
lua-l archive

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


On Fri, May 17, 2019 at 3:43 PM Sean Conner <sean@conman.org> wrote:

>   I'm relunctant to add a C function *just for a constant*.

The GNU libc doc for BUFSIZ says "Actually, you can get an even better
value to use for the buffer size by means of the fstat system call: it
is found in the st_blksize field of the file attributes."

And `stat --help` says:
...
Valid format sequences for file systems:
  ...
  %s   block size (for faster transfers)


So maybe:
io.popen('stat -f / -c %s')


 - Jeff