make detection of local files into a functio, to ease use in Win OS