Loading/running .pdz files in data directory

Only .pdz files in the application directory is allowed to be loading/running, but it would be nice if the data directory is also allowed!

So far, it seems that even if there is a .pdz file in the Data Directory, it cannot be opened.
TestLua.zip (4.6 KB)

Sample code:

-- main.lua
playdate.file.run("module01")
function playdate.update()
end
-- Module01.lua
print(”Module01 Loaded.”)

Result:

Module01 Loaded.

Result (Deleting Module01.pdz):
Deleting Module01.pdz in the application folder will, of course, result in a file not found.

main.lua:1: file not found: module01
stack traceback:
[C]: in field 'run'
main.lua:1: in main chunk

Result (Moving Module01.pdz):
Moving Module01.pdz to the data folder, the file seems to be found, but I can't seem to open it.

main.lua:1: sd_open returned NULL
stack traceback:
[C]: in field 'run'
main.lua:6: in main chunk

2 Likes

I have been looking into this as well and am having the same issue.
I am trying to allow people to put new functionality into custom levels for Diora, essentially mods.

I'd be curious to know if this is intentional or not, I can imagine it might be due to a security issue, but the error is generic so hopefully not!

3 Likes