I was wanting to create a new pasture inside the user's device, that is, inside the root folder, but it does not seem to me that anyone has tried this before, so I tried to do the following:
First, I thought the following: "If I want to create a folder inside the root folder,
I will need to know the root folder path first," then I found that there is a pattern
and the path is: "/storage/emulated/0/"
Then, i tried make this:
local lfs = require( "lfs" ) -- Get raw path to the app temporary directory local temp_path = system.pathForFile( "", "/storage/emulated/0/" ) -- Change current working directory local success = lfs.chdir( temp_path ) --returns true on success local new_folder_path if ( success ) then lfs.mkdir( "NovaPasta" ) new_folder_path = lfs.currentdir() .. "/NovaPasta" end
* link of api
But as I already imagined, it did not work .. Does anyone know how I can create a new folder inside the root folder of the device? (The folder that I call root folder, is the one in which you have all the folders of the phone, the Whatsapp folder, Download, etc ...)