I searched out and finally got the answer that the problem.This is how to create a new recording in specified folder
r = media.newRecording( new_folder_path.."/"..dataFileName )
This line would automatically create a file in this folder as mentioned in the question.
system.pathForFile()
only creates a file automatically when the second argument is a base directory like system.DocumentsDirectory
(as it is clearly mentioned in the documentation that the second argument is constant and it should be only any base directory).
so if you want to create a new file r want to find the path of the file you would append folder name before the file name like my folder/my file
Hope this would help