Handle file names with spaces correctly