[Toybox] toy request: fallocate

hhm heehooman at gmail.com
Fri Aug 9 02:22:14 PDT 2013


Here is a request for a new toy:

fallocate

This would be similar to the "readlink" toy; a wrapper for a syscall.

A similar effect can be procured by making a sparse file using
"truncate" or a zeroed file by using "dd" and /dev/zero as input
("if="). However, "truncate" does something different (sparse file
instead of real file), and "dd" takes much longer, since it writes the
file in addition to allocating it.

See <https://wiki.archlinux.org/index.php/Swap#Swap_file_creation> for
an example.

It is likely simple to implement this, at least the basic (no optional
args; only mandatory filename/size params) functionality.

Someone more familiar with toybox source and C can likely do a good
job for this :-).

Thanks BTW for the awesome project! Following it with interest. Love
its simplicity and straightforward interface!

 1376040134.0


More information about the Toybox mailing list