Modfied getFiles to work with all platform