filename character escaping

Spaces in filenames should be escaped here.