escape single quotes in file paths

If a file name contains a `'` then the file preloading basename arg explodes. Untested.