Slab - An Immediate Mode GUI Library In Lua

grump
Party member
Posts: 598
Joined: Sat Jul 22, 2017 7:43 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Hi guys, I quickly pasted this code together from code I had lying around. Maybe it's useful for what you're trying to do here. It's partly based on lovefs, but without all the weirdness. It provides these functions:

Code: Select all

fileList
driveList
currentDirectory
changeDirectory
writeFile
writeTextFile
splitPath
makePath

for Windows and POSIX systems. I have used this in a bunch of tool projects.

Example:

Code: Select all

local fs = require('fs')

local f = fs.fileList()
for _,v in ipairs(f) do
print(v.type, v.name)
end
I didn't know there's still a need for such a lib... if people are interested, i can make a "real" library out of it, with documentation and stuff, and better function naming.

Edit: oh I just realized that splitPath and makePath depends on code not included here. Sorry about that. You can just remove them, rewrite them or not use them.

coding.jackalope
Prole
Posts: 17
Joined: Sun Feb 24, 2019 6:30 pm

Re: Slab - An Immediate Mode GUI Library In Lua

Thanks for the feedback guys.
pgimeno wrote:
Fri Nov 01, 2019 11:06 pm
I've found a quoting problem which could become a security problem. The quoting of command-line parameters in commands executed via os.popen is insufficient in Linux and OSX. I've created a patch: https://notabug.org/pgimeno/Slab/pulls/1 together with other Linux&OSX fixes.

However, this method for file list retrieval should be a last resort when every other alternative is exhausted. As I see it, there are at least three alternatives, in order of preference:
grump wrote:
Sun Nov 03, 2019 9:44 am
Hi guys, I quickly pasted this code together from code I had lying around. Maybe it's useful for what you're trying to do here. It's partly based on lovefs, but without all the weirdness. It provides these functions:
Thanks for the filesystem suggestions! I have been looking for an alternative to luafilesystem as I didn't want to have that binary dependency to use Slab. lovefs is exactly what I am looking for!

Who is online

Users browsing this forum: No registered users and 2 guests