function writeFile(directory,fns,rundir,cntr)
if isempty(strfind([directory filesep fns.name],'.svn'))
    fid=fopen([rundir filesep 'demo' num2str(cntr) '.txt'],'a');
    fprintf(fid,'%s\n',[directory filesep fns.name]);
    fclose(fid);
end