Unexpected behaviour for datastore, mkdir using experimental /Shared folder

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 imported or copy/pasted into a blank project:
bugreport.lua.zip (729 Bytes)

1 Like

Hi Dimitri! I've got a fix in for this and hope to get 2.4.1 out in the next few days. Thanks so much for the very detailed bug report! It makes a huge difference in our ability to find the cause of these bugs, and to verify we've fixed them. :pray: