Updated promise code with relevant file system API calls
 Please enter the commit message for your changes. Lines starting