I have saved a few json files in the DocumentsDirectory path but now I want to create a function that will remove all files I’ve saved (Where different users have different file names)
local function clearCache() local allFiles = getAllFilesInPath(system.DocumentsDirectory) for i = #allFiles, 1, -1 do os.remove(allFiles[i]) end end
I would probably need something like the above?
Either remove all files inside, or get all the file names in the directory.
*Edit: Help needed to form this function getAllFilesInPath()