How can I create temporary folder in lua?
I mean, like that i can create tmp file with os.tmpname , I looking for a way to create temporary directory.
This is not possible using just the standard library: Lua's standard library is very limited because it is based only on C's standard library for maximum portability. There is os.tmpname or io.tmpfile but neither can be used for creating a temporary directory. For creating a temporary directory, you need more powerful libraries such as LuaPosix which provides posix.stdlib.mkdtemp(templ).
Alternatively, you could try invoking commands to create a temporary directory using os.execute or io.popen, but this would be even less portable and presumably also less efficient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With