Added the dest_mode() function: it figures out the permissions for