sub folder of sub folder of documentDirectory

Hi, I want to create a folder tree like this

documentDirectory / folderA / folderB / folderC

follow the link below, I could only create folderA.

https://coronalabs.com/blog/2013/02/13/faq-wednesday-sub-folder-and-file-access/

Anyone can tell me how to create folderB under A or C under B?

local lfs = require "lfs" -- get raw path to app's Documents directory local docs\_path = system.pathForFile( "", system.DocumentsDirectory ) -- change current working directory local success = lfs.chdir( docs\_path ) -- returns true on success local new\_folder\_path if success then lfs.mkdir( "folderA" ) lfs.mkdir( "folderA/folderB" ) lfs.mkdir( "folderA/folderB/folderC" ) end

or something like that (untested)

Rob

Great. It is that easy :slight_smile:

(1) create A, (2) then create A/B

I thought Creat A. Then do somethign like lfs.chdir(base/A) will move into base/A. Then Create B in A. But it didn’t seem to work.  thanks Rob

local lfs = require "lfs" -- get raw path to app's Documents directory local docs\_path = system.pathForFile( "", system.DocumentsDirectory ) -- change current working directory local success = lfs.chdir( docs\_path ) -- returns true on success local new\_folder\_path if success then lfs.mkdir( "folderA" ) lfs.mkdir( "folderA/folderB" ) lfs.mkdir( "folderA/folderB/folderC" ) end

or something like that (untested)

Rob

Great. It is that easy :slight_smile:

(1) create A, (2) then create A/B

I thought Creat A. Then do somethign like lfs.chdir(base/A) will move into base/A. Then Create B in A. But it didn’t seem to work.  thanks Rob