Added an optional parameter to create a permanent file