storing files within folder

I want to save my files within a folder but the issue which raising is that my files are storing outside of the folder which is annoying. I am sharing what I have done so far.

– get raw path to app’s Temporary directory
local doc_path = system.pathForFile( “”, system.DocumentsDirectory )

– change current working directory
local success = lfs.chdir( doc_path ) – returns true on success
local new_folder_path

if success then
lfs.mkdir( “MyNewFolder” )
new_folder_path = lfs.currentdir() … “/MyNewFolder”
end

local filePath = system.pathForFile( dataFileName , new_folder_path )
r = media.newRecording(filePath)
–print(“new recording has been started with a name”…dataFileName)
r:startRecording()

but my recorded file is out of this newly created folder
can someone help me here?

thanks [import]uid: 173824 topic_id: 35384 reply_id: 335384[/import]