This call does not handle dirty files and no prompt for the user to save the changes. So you may need to find another one that can handle dirty files.