I'm using SDK 2.4.0 for Linux, freshly downloaded, compiling using pdc
with no special arguments.
While experimenting with the newly experimental /Shared folder in a basic Lua template (a single folder with a main.lua file taken from the "Game Template" example), I attempted to create a new folder and write JSON information to it using datastore.write
. This lead to the discovery of several pieces of unexpected behavior.
(For the purposes of discussion, /data/Shared
represents a directory named "Shared" within the game's data folder.)
datastore.write
was expected to create .json files inside/Shared
, but instead creates .tmp files.datastore.write
also unexpectedly creates a/data/Shared
folder, even though the .tmp file is written to/Shared
.datastore.delete
was expected to delete .json files inside/Shared
, but only deletes files from/data/Shared
.datastore.writeImage
was expected to write image files inside/Shared
, but only writes files to/data/Shared
.file.mkdir
was expected to create directories inside/Shared
, but only creates directories in/data/Shared
.
This behavior appears to be consistent regardless of whether the game is run in the simulator while located elsewhere, installed in the simulator's /Games folder, or installed to PLAYDATE/Games using data disk mode.
The relevant folders before running my test code:
The relevant folders after running my test code:
The test code itself, including my running notes, a single Lua file which can be
import
ed or copy/pasted into a blank project:bugreport.lua.zip (729 Bytes)